[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - 7 commits - download.lst i18npool/source sc/source svl/source sw/source toolkit/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Sun Apr 7 10:22:09 UTC 2019


 download.lst                                    |    4 +--
 i18npool/source/calendar/calendar_gregorian.cxx |    9 ++++---
 i18npool/source/localedata/data/ja_JP.xml       |    5 ++++
 i18npool/source/localedata/data/kmr_Latn_TR.xml |   13 ++++++++--
 sc/source/ui/inc/printfun.hxx                   |    5 +++-
 sc/source/ui/view/printfun.cxx                  |   23 ++++++++++++++-----
 svl/source/numbers/zformat.cxx                  |    3 ++
 sw/source/core/doc/notxtfrm.cxx                 |   29 ++++++++++++++++++++++--
 sw/source/core/unocore/unostyle.cxx             |    3 +-
 toolkit/source/controls/tabpagemodel.cxx        |    5 ++--
 10 files changed, 78 insertions(+), 21 deletions(-)

New commits:
commit a2e9561f8aa474960171a91691218fbfb171f6d9
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Sat Apr 6 22:18:41 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:25:33 2019 +0200

    Upgrade to language-subtag-registry-2019-04-03
    
    Change-Id: I4713b15061e831e1dfeccf8d59e46c0aa2ac4a18
    Reviewed-on: https://gerrit.libreoffice.org/70351
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins

diff --git a/download.lst b/download.lst
index 4b54bbda095d..2ff2b38aa6c4 100644
--- a/download.lst
+++ b/download.lst
@@ -150,8 +150,8 @@ export JFREEREPORT_SAC_SHA256SUM := 085f2112c51fa8c1783fac12fbd45265059641512134
 export JFREEREPORT_SAC_TARBALL := 39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip
 export LIBJPEG_TURBO_SHA256SUM := b24890e2bb46e12e72a79f7e965f409f4e16466d00e1dd15d93d73ee6b592523
 export LIBJPEG_TURBO_TARBALL := libjpeg-turbo-1.5.3.tar.gz
-export LANGTAGREG_SHA256SUM := b7ad618b7db518155f00490a11b861496864f18b23b4b537eb80bfe84ca6f854
-export LANGTAGREG_TARBALL := language-subtag-registry-2018-03-30.tar.bz2
+export LANGTAGREG_SHA256SUM := a1d7fb901764bb8f251d4f686cdf565764f9987d0fb5d9315d54a7366a84822d
+export LANGTAGREG_TARBALL := language-subtag-registry-2019-04-03.tar.bz2
 export LANGUAGETOOL_SHA256SUM := 48c87e41636783bba438b65fd895821e369ed139e1465fac654323ad93c5a82d
 export LANGUAGETOOL_TARBALL := b63e6340a02ff1cacfeadb2c42286161-JLanguageTool-1.7.0.tar.bz2
 export LCMS2_SHA256SUM := 48c6fdf98396fa245ed86e622028caf49b96fa22f3e5734f853f806fbc8e7d20
commit ee1033abf489b77e60af9f9eb77267afa0952325
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed Feb 6 00:41:25 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:21:14 2019 +0200

    basic: fix for UnoControlTabPageModel get/set properties
    
    The userformscontainers is required property to pass checks in
    getter/setter, but returning true instead of actual type is
    not a best idea. So let's return actually expected dummy empty
    container.
    
    Change-Id: I5cc3e5462ed82f6f2f8e5a45d9fc2d9f9ce1c76f
    Reviewed-on: https://gerrit.libreoffice.org/67431
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 24e7d98219191ccdab3673ac96fa866c449cac5f)
    Reviewed-on: https://gerrit.libreoffice.org/70235
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx
index da7409162b88..c4fda04a4439 100644
--- a/toolkit/source/controls/tabpagemodel.cxx
+++ b/toolkit/source/controls/tabpagemodel.cxx
@@ -89,9 +89,10 @@ Any UnoControlTabPageModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
             break;
         case BASEPROPERTY_USERFORMCONTAINEES:
         {
-            // We do not have here any usercontainers (yet?), but let's return something back
+            // We do not have here any usercontainers (yet?), but let's return empty container back
             // so normal properties could be set without triggering UnknownPropertyException
-            return makeAny(true);
+            aAny <<= uno::Reference< XNameContainer >();
+            break;
         }
         default:
             aAny = UnoControlModel::ImplGetDefaultValue( nPropId );
commit 585390e244b9d4fa5e0bd2afbee5ec27e223ac4d
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jul 26 20:46:23 2018 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:20:13 2019 +0200

    Introduce next Japanese gengou era 'Reiwa'
    
    Prepare for "Japan's Y2K" Gengou calendar era switch after 2019-04-30
    
    The emperor Akihito will abdicate on 2019-04-30. The next emperor
    will be Naruhito, but so far neither the new era name (Heisei for
    Akihito) nor its abbreviation or a Unicode character are
    determined. At least introduce the new era with some dummy names
    (Naruhito,Na,N).
    
    Change-Id: I8c0af390ca0408ac259e47e7eaf2e49b5889c9ba
    Reviewed-on: https://gerrit.libreoffice.org/58142
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    
    Introduce next Japanese gengou era 'Reiwa'
    
    starting from 2019-05-01, which has been announced officially.
    
    This fills the provisional slot acknowledged at
    cacbb0faef77ae8462de9ff5c7307a6a2e28b2bb.
    
    Change-Id: Ifb12e6afaad4c66d455f664b46ec946e80324e87
    Reviewed-on: https://gerrit.libreoffice.org/70157
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    Reviewed-on: https://gerrit.libreoffice.org/70185

diff --git a/i18npool/source/calendar/calendar_gregorian.cxx b/i18npool/source/calendar/calendar_gregorian.cxx
index 522a2cf8a077..93201242f8f9 100644
--- a/i18npool/source/calendar/calendar_gregorian.cxx
+++ b/i18npool/source/calendar/calendar_gregorian.cxx
@@ -206,10 +206,11 @@ Calendar_hanja::loadCalendar( const OUString& /*uniqueID*/, const css::lang::Loc
 }
 
 static const Era gengou_eraArray[] = {
-    {1868,  1,  1, 0},
-    {1912,  7, 30, 0},
-    {1926, 12, 25, 0},
-    {1989,  1,  8, 0},
+    {1868,  1,  1, 0},  // Meiji
+    {1912,  7, 30, 0},  // Taisho
+    {1926, 12, 25, 0},  // Showa
+    {1989,  1,  8, 0},  // Heisei
+    {2019,  5,  1, 0},  // Reiwa
     {0, 0, 0, 0}
 };
 Calendar_gengou::Calendar_gengou() : Calendar_gregorian(gengou_eraArray)
diff --git a/i18npool/source/localedata/data/ja_JP.xml b/i18npool/source/localedata/data/ja_JP.xml
index 7d7526062799..c15c665f2eab 100644
--- a/i18npool/source/localedata/data/ja_JP.xml
+++ b/i18npool/source/localedata/data/ja_JP.xml
@@ -480,6 +480,11 @@
           <DefaultAbbrvName>平</DefaultAbbrvName>
           <DefaultFullName>平成</DefaultFullName>
         </Era>
+        <Era>
+          <EraID>Reiwa</EraID>
+          <DefaultAbbrvName>令</DefaultAbbrvName>
+          <DefaultFullName>令和</DefaultFullName>
+        </Era>
       </Eras>
       <StartDayOfWeek>
         <DayID>sun</DayID>
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index c42765160494..0284d1117736 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -3380,6 +3380,9 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& OutString,
         case 4:
             cEra = 'H';
             break;
+        case 5:
+            cEra = 'R';
+            break;
         default:
             cEra = '?';
             break;
commit 7de7cbfe6df37eb7d957b86f1d02a43e8306b5bf
Author:     Armin Le Grand <Armin.Le.Grand at me.com>
AuthorDate: Tue Apr 2 17:59:40 2019 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:19:47 2019 +0200

    tdf#124272 use ClipRegion's geometry if not a rectangle
    
    By error the ClipRegion's geometry was replaced by it's
    BoundRect expanded to PixelBounds. If the ClipRegion
    is not a rectangle, this will create wrong results. To
    do both - extend to PixelBounds and have the original
    geometry included - use the PolyPolygon topology as
    needed (see comment in code for details)
    
    Reviewed-on: https://gerrit.libreoffice.org/70146
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at me.com>
    (cherry picked from commit 362c1cf2bd580f6dc8bf27bdcd79174111bc1b5c)
    
    Conflicts:
            sw/source/core/doc/notxtfrm.cxx
    
    Change-Id: If3f75223144eba8eb23909a7c701ad544346099b
    Reviewed-on: https://gerrit.libreoffice.org/70158
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index fd21b43bb3c7..e790cc57fd13 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1047,9 +1047,34 @@ void paintGraphicUsingPrimitivesHelper(
                     ceil(aClipRange.getMaxX() + aSinglePixelXY.getX()),
                     ceil(aClipRange.getMaxY() + aSinglePixelXY.getY()));
 
+                // create the enclosing rectangle as polygon
+                basegfx::B2DPolyPolygon aTarget(basegfx::utils::createPolygonFromRect(aExpandedClipRange));
+
+                // tdf#124272 the fix above (tdf#114076) was too rough - the
+                // clip region used may be a PolyPolygon. In that case that
+                // PolyPolygon would have to be scaled to mentioned PixelBounds.
+                // Since that is not really possible geometrically (would need
+                // more some 'grow in outside direction' but with unequal grow
+                // values in all directions - just maaany problems
+                // involved), use a graphical trick: The topology of the
+                // PolyPolygon uses the stndard FillRule, so adding the now
+                // guaranteed to be bigger or equal bounding (enclosing)
+                // rectangle twice as polygon will expand the BoundRange, but
+                // not change the geometry visualization at all
+                if(!rOutputDevice.GetClipRegion().IsRectangle())
+                {
+                    // double the outer rectangle range polygon to have it
+                    // included twice
+                    aTarget.append(aTarget.getB2DPolygon(0));
+
+                    // add the original clip 'inside' (due to being smaller
+                    // or equal). That PolyPolygon may have an unknown number
+                    // of polygons (>=1)
+                    aTarget.append(aClip);
+                }
+
                 aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
-                    basegfx::B2DPolyPolygon(
-                        basegfx::utils::createPolygonFromRect(aExpandedClipRange)),
+                    aTarget,
                     aContent);
             }
         }
commit 38ad10501e8168eadd786906b5100c2834621df8
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Mar 25 12:06:20 2019 +0000
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:14:18 2019 +0200

    Resolves: tdf#124142 don't deref nullptr
    
    Change-Id: Ie14600e9f9a1e1c4e99c7a872f5d677453481888
    Reviewed-on: https://gerrit.libreoffice.org/69666
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ac7ce7a64ef903bad1476f5635a7b2a1e951a7a3)
    Reviewed-on: https://gerrit.libreoffice.org/69694
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 3839de130984..a13e01ee30ab 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -193,7 +193,8 @@ namespace sw
             , m_pBasePool(pDocShell->GetStyleSheetPool())
             , m_pDocShell(pDocShell)
         {
-            StartListening(*m_pBasePool);
+            if (m_pBasePool) //tdf#124142 html docs can have no styles
+                StartListening(*m_pBasePool);
         }
 
         //XIndexAccess
commit 1ff3af58638f760c2dcee6297880a62cbfa6622b
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Mon Mar 25 22:33:03 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:13:40 2019 +0200

    Assign [kmr-Latn-TR] TRY|₺ currency, TRY|YTL and TRL|TL are legacyOnly
    
    This was done long ago for the tr-TR locale as well.
    
    Change-Id: I5bf8595f6d49adb7fd76b3c4924c4d72b3b8ea5e
    Reviewed-on: https://gerrit.libreoffice.org/69717
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 4ca9db953d59d93ce8e3a54a36d23ed52b9c62a9)
    Reviewed-on: https://gerrit.libreoffice.org/69723
    Tested-by: Eike Rathke <erack at redhat.com>
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/i18npool/source/localedata/data/kmr_Latn_TR.xml b/i18npool/source/localedata/data/kmr_Latn_TR.xml
index 2762df9e630f..a566c67170b9 100644
--- a/i18npool/source/localedata/data/kmr_Latn_TR.xml
+++ b/i18npool/source/localedata/data/kmr_Latn_TR.xml
@@ -52,7 +52,7 @@
     <TimePM>PN</TimePM>
     <MeasurementSystem>US</MeasurementSystem>
   </LC_CTYPE>
-  <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$TL-626]">
+  <LC_FORMAT replaceFrom="[CURRENCY]" replaceTo="[$₺-626]">
     <DateAcceptancePattern>M/D</DateAcceptancePattern>
     <FormatElement msgid="FixedFormatskey1" default="true" type="medium" usage="FIXED_NUMBER" formatindex="0">
       <FormatCode>General</FormatCode>
@@ -335,14 +335,21 @@
     </Calendar>
   </LC_CALENDAR>
   <LC_CURRENCY>
-    <Currency default="true" usedInCompatibleFormatCodes="false">
+    <Currency default="true" usedInCompatibleFormatCodes="true">
+      <CurrencyID>TRY</CurrencyID>
+      <CurrencySymbol>₺</CurrencySymbol>
+      <BankSymbol>TRY</BankSymbol>
+      <CurrencyName>Türk Lirası</CurrencyName>
+      <DecimalPlaces>2</DecimalPlaces>
+    </Currency>
+    <Currency default="false" usedInCompatibleFormatCodes="false" legacyOnly="true">
       <CurrencyID>TRY</CurrencyID>
       <CurrencySymbol>YTL</CurrencySymbol>
       <BankSymbol>TRY</BankSymbol>
       <CurrencyName>Yeni Türk Lirası</CurrencyName>
       <DecimalPlaces>2</DecimalPlaces>
     </Currency>
-    <Currency default="false" usedInCompatibleFormatCodes="true">
+    <Currency default="false" usedInCompatibleFormatCodes="false" legacyOnly="true">
       <CurrencyID>TRL</CurrencyID>
       <CurrencySymbol>TL</CurrencySymbol>
       <BankSymbol>TRL</BankSymbol>
commit f185179475a71aa9b7ad91531097a8a41c9f12a4
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Mar 5 12:41:44 2019 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Apr 7 11:12:27 2019 +0200

    do not access uninitialized values when printing (tdf#121439)
    
    The assert in the bugreport is triggered by ScPrintFunc::CalcPages() passing
    uninitialized values of nEndRow (and others). These variables apparently
    get initialized only by constructors that take ScPrintState. These ctors
    also set (the somewhat poorly named) bState and the call to CalcPages()
    is guarded by this. However, GetPrintState() will simply create ScPrintState
    filled with these uninitialized values and later on this will be used
    with these ctors, so bState will be set, but nEndRow will be bogus.
    
    Although 5217a2a0bf27e496cc429ee45dff7c239b466ae6 introduced tdf#121439,
    this strange bState logic and unitialized variables has been these since
    the initial commit, and the code doesn't take any precautions to check
    whether the values are valid or not, so I assume this always was just lucky
    enough to work and 5217a2a0bf finally triggered a problem.
    
    Given that it's rather unclear to me how this is supposed to work properly,
    just add an extra flag to both ScPrintFunc and ScPrintState marking whether
    the values are set or not and make CalcPages() depends on this flag instead.
    
    Change-Id: I0620de6562865c24f5a0edca2566b01546bf2e2b
    Reviewed-on: https://gerrit.libreoffice.org/68739
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Jenkins
    (cherry picked from commit 9432bab9f8f4a246d205ff2a460f60aeedba8ce1)
    Reviewed-on: https://gerrit.libreoffice.org/69262
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 2df47432c89a..fd2f486ac5ce 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -153,6 +153,7 @@ struct ScPrintState                         //  Save Variables from ScPrintFunc
     SCROW   nStartRow;
     SCCOL   nEndCol;
     SCROW   nEndRow;
+    bool    bPrintAreaValid; // the 4 variables above are set
     sal_uInt16  nZoom;
     size_t  nPagesX;
     size_t  nPagesY;
@@ -175,6 +176,7 @@ struct ScPrintState                         //  Save Variables from ScPrintFunc
         , nStartRow(0)
         , nEndCol(0)
         , nEndRow(0)
+        , bPrintAreaValid(false)
         , nZoom(0)
         , nPagesX(0)
         , nPagesY(0)
@@ -212,7 +214,7 @@ private:
     const ScRange*      pUserArea;          //  Selection, if set in dialog
 
     const SfxItemSet*   pParamSet;          //  Selected template
-    bool                bState;             // created from State-struct
+    bool                bFromPrintState;    // created from State-struct
 
                                             //  Parameter from template:
     sal_uInt16          nLeftMargin;
@@ -261,6 +263,7 @@ private:
     SCROW               nStartRow;
     SCCOL               nEndCol;
     SCROW               nEndRow;
+    bool                bPrintAreaValid; // the 4 variables above are set
 
     sc::PrintPageRanges m_aRanges;
 
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index a009dca5b88e..87022c225d45 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -191,7 +191,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions )
         pParamSet = nullptr;
     }
 
-    if (!bState)
+    if (!bFromPrintState)
         nZoom = 100;
     nManualZoom = 100;
     bClearWin = false;
@@ -214,13 +214,14 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa
         nPageStart          ( nPage ),
         nDocPages           ( nDocP ),
         pUserArea           ( pArea ),
-        bState              ( false ),
+        bFromPrintState     ( false ),
         bSourceRangeValid   ( false ),
         bPrintCurrentTable  ( false ),
         bMultiArea          ( false ),
         mbHasPrintRange(true),
         nTabPages           ( 0 ),
         nTotalPages         ( 0 ),
+        bPrintAreaValid     ( false ),
         pPageData           ( pData )
 {
     pDev = pPrinter.get();
@@ -247,6 +248,7 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* pNewPrinter,
     nStartRow   = rState.nStartRow;
     nEndCol     = rState.nEndCol;
     nEndRow     = rState.nEndRow;
+    bPrintAreaValid = rState.bPrintAreaValid;
     nZoom       = rState.nZoom;
     m_aRanges.m_nPagesX = rState.nPagesX;
     m_aRanges.m_nPagesY = rState.nPagesY;
@@ -254,7 +256,7 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* pNewPrinter,
     nTotalPages = rState.nTotalPages;
     nPageStart  = rState.nPageStart;
     nDocPages   = rState.nDocPages;
-    bState      = true;
+    bFromPrintState = true;
 
     if (rState.bSavedStateRanges)
     {
@@ -279,13 +281,14 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell, SCTAB nTab,
         nPageStart          ( nPage ),
         nDocPages           ( nDocP ),
         pUserArea           ( pArea ),
-        bState              ( false ),
+        bFromPrintState     ( false ),
         bSourceRangeValid   ( false ),
         bPrintCurrentTable  ( false ),
         bMultiArea          ( false ),
         mbHasPrintRange(true),
         nTabPages           ( 0 ),
         nTotalPages         ( 0 ),
+        bPrintAreaValid     ( false ),
         pPageData           ( nullptr )
 {
     pDev = pOutDev;
@@ -311,6 +314,7 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell,
     nStartRow   = rState.nStartRow;
     nEndCol     = rState.nEndCol;
     nEndRow     = rState.nEndRow;
+    bPrintAreaValid = rState.bPrintAreaValid;
     nZoom       = rState.nZoom;
     m_aRanges.m_nPagesX = rState.nPagesX;
     m_aRanges.m_nPagesY = rState.nPagesY;
@@ -318,7 +322,7 @@ ScPrintFunc::ScPrintFunc( OutputDevice* pOutDev, ScDocShell* pShell,
     nTotalPages = rState.nTotalPages;
     nPageStart  = rState.nPageStart;
     nDocPages   = rState.nDocPages;
-    bState      = true;
+    bFromPrintState = true;
 
     if (rState.bSavedStateRanges)
     {
@@ -339,6 +343,7 @@ void ScPrintFunc::GetPrintState(ScPrintState& rState,  bool bSavePageRanges)
     rState.nStartRow    = nStartRow;
     rState.nEndCol      = nEndCol;
     rState.nEndRow      = nEndRow;
+    rState.bPrintAreaValid = bPrintAreaValid;
     rState.nZoom        = nZoom;
     rState.nPagesX      = m_aRanges.m_nPagesX;
     rState.nPagesY      = m_aRanges.m_nPagesY;
@@ -370,6 +375,7 @@ void ScPrintFunc::FillPageData()
         sal_uInt16 nCount = sal::static_int_cast<sal_uInt16>( pPageData->GetCount() );
         ScPrintRangeData& rData = pPageData->GetData(nCount);       // count up
 
+        assert( bPrintAreaValid );
         rData.SetPrintRange( ScRange( nStartCol, nStartRow, nPrintTab,
                                         nEndCol, nEndRow, nPrintTab ) );
         // #i123672#
@@ -694,6 +700,7 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew )
         nStartRow = 0;
         if (!pDoc->GetPrintArea( nPrintTab, nEndCol, nEndRow, bNotes ))
             return false;   // nothing
+        bPrintAreaValid = true;
     }
     else
     {
@@ -732,10 +739,12 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew )
         if (!bFound)
             return false;   // empty
 
+        bPrintAreaValid = true;
         if (bForcedChangeRow)
             bChangeRow = true;
     }
 
+    assert( bPrintAreaValid );
     pDoc->ExtendMerge( nStartCol,nStartRow, nEndCol,nEndRow, nPrintTab );  // no Refresh, incl. Attrs
 
     if ( bChangeCol )
@@ -1055,7 +1064,7 @@ void ScPrintFunc::InitParam( const ScPrintOptions* pOptions )
 
             //  Split pages
 
-    if (!bState)
+    if (!bPrintAreaValid)
     {
         nTabPages = CountPages();                                   // also calculates zoom
         nTotalPages = nTabPages;
@@ -2545,6 +2554,7 @@ long ScPrintFunc::CountNotePages()
 
         if (bDoThis)
         {
+            assert( bPrintAreaValid );
             for ( SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol )
             {
                 if (pDoc->HasColNotes(nCol, nPrintTab))
@@ -3004,6 +3014,7 @@ static void lcl_SetHidden( const ScDocument* pDoc, SCTAB nPrintTab, ScPageRowEnt
 
 void ScPrintFunc::CalcPages()               // calculates aPageRect and pages from nZoom
 {
+    assert( bPrintAreaValid );
     m_aRanges.calculate(pDoc, aTableParam.bSkipEmpty, aAreaParam.bPrintArea, nStartRow, nEndRow, nStartCol, nEndCol, nPrintTab, GetDocPageSize());
 }
 


More information about the Libreoffice-commits mailing list