Kaydet (Commit) e758f6fa authored tarafından Ivan Timofeev's avatar Ivan Timofeev Kaydeden (comit) Caolán McNamara

fix doubling of one page when range is empty and incorrect selection page

üst 6cb60808
...@@ -210,18 +210,29 @@ namespace { ...@@ -210,18 +210,29 @@ namespace {
OUString GetPrinterSelection (sal_Int32 nPageCount, sal_Int32 nCurrentPageIndex) const OUString GetPrinterSelection (sal_Int32 nPageCount, sal_Int32 nCurrentPageIndex) const
{ {
sal_Int32 nContent = static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 )); sal_Int32 nContent = static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 ));
OUString sValue = ::rtl::OUStringBuffer(4) OUString sFullRange = ::rtl::OUStringBuffer()
.append(static_cast<sal_Int32>(1)) .append(static_cast<sal_Int32>(1))
.append(static_cast<sal_Unicode>('-')) .append(static_cast<sal_Unicode>('-'))
.append(nPageCount).makeStringAndClear(); .append(nPageCount).makeStringAndClear();
if( nContent == 1 ) if (nContent == 0) // all pages/slides
sValue = mrProperties.getStringValue( "PageRange", sValue ); {
else if ( nContent == 2 ) return sFullRange;
sValue = nCurrentPageIndex < 0 }
? OUString() : OUString::valueOf(nCurrentPageIndex);
if (nContent == 1) // range
return sValue; {
OUString sValue = mrProperties.getStringValue("PageRange");
return sValue.getLength() ? sValue : sFullRange;
}
if (nContent == 2 && // selection
nCurrentPageIndex >= 0)
{
return OUString::valueOf(nCurrentPageIndex + 1);
}
return OUString();
} }
private: private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment