[Libreoffice-commits] core.git: sc/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Dec 12 23:58:44 UTC 2017


 sc/source/ui/unoobj/docuno.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c7a2538129f16ef1253ae974737d5c9676aaf883
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Dec 12 22:24:45 2017 +0900

    tdf#114384 reset the print state if the sheet changes
    
    Change-Id: Ia90a2bae0dab3d82cae1204a9205f386f71e5c49
    Reviewed-on: https://gerrit.libreoffice.org/46301
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 0df42b9be2f1..d5560485bc62 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1787,7 +1787,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
     else
     {
         std::unique_ptr<ScPrintFunc, o3tl::default_delete<ScPrintFunc>> pPrintFunc;
-        if (m_pPrintState)
+        if (m_pPrintState && m_pPrintState->nPrintTab == nTab)
             pPrintFunc.reset(new ScPrintFunc(pDocShell, pDocShell->GetPrinter(), *m_pPrintState, &aStatus.GetOptions()));
         else
             pPrintFunc.reset(new ScPrintFunc(pDocShell, pDocShell->GetPrinter(), nTab,
@@ -1934,7 +1934,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
 
 
     std::unique_ptr<ScPrintFunc, o3tl::default_delete<ScPrintFunc>> pPrintFunc;
-    if (m_pPrintState)
+    if (m_pPrintState && m_pPrintState->nPrintTab == nTab)
         pPrintFunc.reset(new ScPrintFunc(pDev, pDocShell, *m_pPrintState, &aStatus.GetOptions()));
     else
         pPrintFunc.reset(new ScPrintFunc(pDev, pDocShell, nTab, pPrintFuncCache->GetFirstAttr(nTab), nTotalPages, pSelRange, &aStatus.GetOptions()));


More information about the Libreoffice-commits mailing list