diff options
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r-- | core/fpdfdoc/cpdf_pagelabel.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/core/fpdfdoc/cpdf_pagelabel.cpp b/core/fpdfdoc/cpdf_pagelabel.cpp index 5efb18ef3d..d0693086ab 100644 --- a/core/fpdfdoc/cpdf_pagelabel.cpp +++ b/core/fpdfdoc/cpdf_pagelabel.cpp @@ -50,23 +50,25 @@ WideString MakeLetters(int num) { } WideString GetLabelNumPortion(int num, const ByteString& bsStyle) { - WideString wsNumPortion; if (bsStyle.IsEmpty()) - return wsNumPortion; - if (bsStyle == "D") { - wsNumPortion.Format(L"%d", num); - } else if (bsStyle == "R") { - wsNumPortion = MakeRoman(num); + return L""; + if (bsStyle == "D") + return WideString::Format(L"%d", num); + if (bsStyle == "R") { + WideString wsNumPortion = MakeRoman(num); wsNumPortion.MakeUpper(); - } else if (bsStyle == "r") { - wsNumPortion = MakeRoman(num); - } else if (bsStyle == "A") { - wsNumPortion = MakeLetters(num); + return wsNumPortion; + } + if (bsStyle == "r") + return MakeRoman(num); + if (bsStyle == "A") { + WideString wsNumPortion = MakeLetters(num); wsNumPortion.MakeUpper(); - } else if (bsStyle == "a") { - wsNumPortion = MakeLetters(num); + return wsNumPortion; } - return wsNumPortion; + if (bsStyle == "a") + return MakeLetters(num); + return L""; } } // namespace @@ -114,7 +116,7 @@ bool CPDF_PageLabel::GetLabel(int nPage, WideString* wsLabel) const { return true; } } - wsLabel->Format(L"%d", nPage + 1); + *wsLabel = WideString::Format(L"%d", nPage + 1); return true; } |