sw/qa/extras/htmlexport/htmlexport.cxx                       |   10 
 sw/qa/extras/layout/data/hidden-sections-with-pagestyles.odt |binary
 sw/qa/extras/layout/layout.cxx                               |  117 +++++++++++
 sw/source/core/layout/laycache.cxx                           |   68 +++---
 sw/source/core/layout/layhelp.hxx                            |    3 
 sw/source/core/layout/sectfrm.cxx                            |   58 +++++
 6 files changed, 223 insertions(+), 33 deletions(-)

New commits:
commit 08a430e1a71530479622f5ffaf77a977ad988d9d
Author:     Michael Stahl <[email protected]>
AuthorDate: Thu Aug 29 13:27:03 2024 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Fri Aug 30 15:36:22 2024 +0200

    sw: layout: fix page breaks when unhiding a hidden section
    
    Commit ff7f1b59e22092d8548459e75fe912db852f056f removed the
    DelFrames()/MakeFrames() in SwSection::ImplSetHiddenFlag(), which was
    handling the page breaks previously.
    
    Add some code to SwSectionFrame::SwClientNotify() to call
    SwLayHelper::CheckInsertPage() which appears to be the important part
    called by InsertCnt_() previously.
    
    Change-Id: Id6560d8706abf92fba259a5d534d6cd5067c8e6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172609
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit a97e245ba11598050e1800fde9ace796d20e9df2)

diff --git a/sw/qa/extras/layout/data/hidden-sections-with-pagestyles.odt 
b/sw/qa/extras/layout/data/hidden-sections-with-pagestyles.odt
new file mode 100644
index 000000000000..5b33e7cc86a1
Binary files /dev/null and 
b/sw/qa/extras/layout/data/hidden-sections-with-pagestyles.odt differ
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 067f2177e0a8..b67a89ec0356 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -50,6 +50,9 @@ protected:
     void CheckRedlineCharAttributesHidden();
 
     SwDoc* createDoc(const char* pName = nullptr);
+
+    uno::Any executeMacro(const OUString& rScriptURL,
+                          const uno::Sequence<uno::Any>& rParams = {});
 };
 
 SwDoc* SwLayoutWriter::createDoc(const char* pName)
@@ -64,6 +67,20 @@ SwDoc* SwLayoutWriter::createDoc(const char* pName)
     return pTextDoc->GetDocShell()->GetDoc();
 }
 
+uno::Any SwLayoutWriter::executeMacro(const OUString& rScriptURL,
+                                  const uno::Sequence<uno::Any>& rParams)
+{
+    uno::Any aRet;
+    uno::Sequence<sal_Int16> aOutParamIndex;
+    uno::Sequence<uno::Any> aOutParam;
+
+    ErrCode result = SfxObjectShell::CallXScript(mxComponent, rScriptURL, 
rParams, aRet,
+                                                 aOutParamIndex, aOutParam);
+    CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, result);
+
+    return aRet;
+}
+
 static void lcl_dispatchCommand(const uno::Reference<lang::XComponent>& 
xComponent,
                                 const OUString& rCommand,
                                 const uno::Sequence<beans::PropertyValue>& 
rPropertyValues)
@@ -4481,6 +4498,106 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, 
testTdf160958_orphans)
     assertXPath(pExportDump, "//page[2]/body/txt[1]/LineBreak", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testHiddenSectionPageDescs)
+{
+    createDoc("hidden-sections-with-pagestyles.odt");
+
+    // hide these just so that the height of the section is what is expected;
+    // otherwise height depends on which tests run previously
+    uno::Sequence<beans::PropertyValue> argsSH(
+        comphelper::InitPropertySequence({ { "ShowHiddenParagraphs", 
uno::Any(false) } }));
+    lcl_dispatchCommand(mxComponent, ".uno:ShowHiddenParagraphs", argsSH);
+    uno::Sequence<beans::PropertyValue> args(
+        comphelper::InitPropertySequence({ { "Fieldnames", uno::Any(false) } 
}));
+    lcl_dispatchCommand(mxComponent, ".uno:Fieldnames", args);
+    Scheduler::ProcessEventsToIdle();
+
+    {
+        xmlDocPtr pXmlDoc = parseLayoutDump();
+        assertXPath(pXmlDoc, "/root/page", 2);
+        assertXPath(pXmlDoc, "/root/page[1]", "formatName", "Hotti");
+        assertXPath(pXmlDoc, "/root/page[1]/body/section", 1);
+        assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName",
+                    u"Verfügung");
+        assertXPath(pXmlDoc, "/root/page[2]/body/section", 2);
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]", "formatName",
+                    u"Verfügung");
+        // should be > 0, no idea why it's different on Windows
+#ifdef _WIN32
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", 
"height",
+                    "552");
+#else
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", 
"height",
+                    "532");
+#endif
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[2]", "formatName",
+                    "Rueckantwort");
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds", 
"height", "0");
+        assertXPath(pXmlDoc, "/root/page[2]", "formatName", "Folgeseite");
+        discardDumpedLayout();
+    }
+
+    // toggle one section hidden and other visible
+    executeMacro(
+        
"vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document");
+    Scheduler::ProcessEventsToIdle();
+
+    {
+        xmlDocPtr pXmlDoc = parseLayoutDump();
+        assertXPath(pXmlDoc, "/root/page", 3);
+        assertXPath(pXmlDoc, "/root/page[1]", "formatName", "Hotti");
+        assertXPath(pXmlDoc, "/root/page[1]/body/section", 2);
+        assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName",
+                    u"Verfügung");
+        assertXPath(pXmlDoc, "/root/page[1]/body/section[2]", "formatName",
+                    "Rueckantwort");
+        assertXPath(pXmlDoc, "/root/page[2]", "formatName", "Empty Page");
+        assertXPath(pXmlDoc, "/root/page[3]/body/section", 1);
+        assertXPath(pXmlDoc, "/root/page[3]/body/section[1]", "formatName",
+                    "Rueckantwort");
+        // should be > 0, no idea why it's different on Windows
+#ifdef _WIN32
+        assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds", 
"height",
+                    "552");
+#else
+        assertXPath(pXmlDoc, "/root/page[3]/body/section[1]/infos/bounds", 
"height",
+                    "532");
+#endif
+        assertXPath(pXmlDoc, "/root/page[3]", "formatName", 
"RueckantwortRechts");
+        discardDumpedLayout();
+    }
+
+    // toggle one section hidden and other visible
+    executeMacro(
+        
"vnd.sun.star.script:Standard.Module1.Main?language=Basic&location=document");
+    Scheduler::ProcessEventsToIdle();
+
+    {
+        xmlDocPtr pXmlDoc = parseLayoutDump();
+        assertXPath(pXmlDoc, "/root/page", 2);
+        assertXPath(pXmlDoc, "/root/page[1]", "formatName", "Hotti");
+        assertXPath(pXmlDoc, "/root/page[1]/body/section", 1);
+        assertXPath(pXmlDoc, "/root/page[1]/body/section[1]", "formatName",
+                    u"Verfügung");
+        assertXPath(pXmlDoc, "/root/page[2]/body/section", 2);
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]", "formatName",
+                    u"Verfügung");
+        // should be > 0, no idea why it's different on Windows
+#ifdef _WIN32
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", 
"height",
+                    "552");
+#else
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[1]/infos/bounds", 
"height",
+                    "532");
+#endif
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[2]", "formatName",
+                    "Rueckantwort");
+        assertXPath(pXmlDoc, "/root/page[2]/body/section[2]/infos/bounds", 
"height", "0");
+        assertXPath(pXmlDoc, "/root/page[2]", "formatName", "Folgeseite");
+        discardDumpedLayout();
+    }
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/laycache.cxx 
b/sw/source/core/layout/laycache.cxx
index ff1ad6a53eb7..0e257292ec8e 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -633,20 +633,25 @@ sal_uLong SwLayHelper::CalcPageCount()
  * The break after flag is set, if the actual content
  * wants a break after.
  */
-bool SwLayHelper::CheckInsertPage()
+bool SwLayHelper::CheckInsertPage(
+    SwPageFrame *& rpPage,
+    SwLayoutFrame *& rpLay,
+    SwFrame *& rpFrame,
+    bool & rIsBreakAfter,
+    bool const isForceBreak)
 {
-    bool bEnd = nullptr == mrpPage->GetNext();
-    const SvxFormatBreakItem& rBrk = mrpFrame->GetBreakItem();
-    const SwFormatPageDesc& rDesc = mrpFrame->GetPageDescItem();
+    bool bEnd = nullptr == rpPage->GetNext();
+    const SvxFormatBreakItem& rBrk = rpFrame->GetBreakItem();
+    const SwFormatPageDesc& rDesc = rpFrame->GetPageDescItem();
     // #118195# Do not evaluate page description if frame
     // is a follow frame!
-    const SwPageDesc* pDesc = mrpFrame->IsFlowFrame() &&
-                              SwFlowFrame::CastFlowFrame( mrpFrame 
)->IsFollow() ?
-                              nullptr :
-                              rDesc.GetPageDesc();
+    const SwPageDesc* pDesc = rpFrame->IsFlowFrame()
+                            && SwFlowFrame::CastFlowFrame(rpFrame)->IsFollow()
+                          ? nullptr
+                          : rDesc.GetPageDesc();
 
-    bool bBrk = mnParagraphCnt > mnMaxParaPerPage || mbBreakAfter;
-    mbBreakAfter = rBrk.GetBreak() == SvxBreak::PageAfter ||
+    bool bBrk = isForceBreak || rIsBreakAfter;
+    rIsBreakAfter = rBrk.GetBreak() == SvxBreak::PageAfter ||
                    rBrk.GetBreak() == SvxBreak::PageBoth;
     if ( !bBrk )
         bBrk = rBrk.GetBreak() == SvxBreak::PageBefore ||
@@ -657,52 +662,53 @@ bool SwLayHelper::CheckInsertPage()
         ::boost::optional<sal_uInt16> oPgNum;
         if ( !pDesc )
         {
-            pDesc = mrpPage->GetPageDesc()->GetFollow();
+            pDesc = rpPage->GetPageDesc()->GetFollow();
 
             SwFormatPageDesc aFollowDesc( pDesc );
             oPgNum = aFollowDesc.GetNumOffset();
             if ( oPgNum )
-                
static_cast<SwRootFrame*>(mrpPage->GetUpper())->SetVirtPageNum(true);
+                
static_cast<SwRootFrame*>(rpPage->GetUpper())->SetVirtPageNum(true);
         }
         else
         {
             oPgNum = rDesc.GetNumOffset();
             if ( oPgNum )
-                
static_cast<SwRootFrame*>(mrpPage->GetUpper())->SetVirtPageNum(true);
+                
static_cast<SwRootFrame*>(rpPage->GetUpper())->SetVirtPageNum(true);
         }
-        bool bNextPageRight = !mrpPage->OnRightPage();
+        bool bNextPageRight = !rpPage->OnRightPage();
         bool bInsertEmpty = false;
-        assert(mrpPage->GetUpper()->GetLower());
+        assert(rpPage->GetUpper()->GetLower());
         if (oPgNum && bNextPageRight != IsRightPageByNumber(
-                    *static_cast<SwRootFrame*>(mrpPage->GetUpper()), *oPgNum))
+                    *static_cast<SwRootFrame*>(rpPage->GetUpper()), *oPgNum))
         {
             bNextPageRight = !bNextPageRight;
             bInsertEmpty = true;
         }
         // If the page style is changing, we'll have a first page.
-        bool bNextPageFirst = pDesc != mrpPage->GetPageDesc();
-        ::InsertNewPage( const_cast<SwPageDesc&>(*pDesc), mrpPage->GetUpper(),
-             bNextPageRight, bNextPageFirst, bInsertEmpty, false, 
mrpPage->GetNext());
+        bool bNextPageFirst = pDesc != rpPage->GetPageDesc();
+        ::InsertNewPage( const_cast<SwPageDesc&>(*pDesc), rpPage->GetUpper(),
+             bNextPageRight, bNextPageFirst, bInsertEmpty, false, 
rpPage->GetNext());
         if ( bEnd )
         {
-            OSL_ENSURE( mrpPage->GetNext(), "No new page?" );
+            OSL_ENSURE( rpPage->GetNext(), "No new page?" );
             do
-            {   mrpPage = static_cast<SwPageFrame*>(mrpPage->GetNext());
-            } while ( mrpPage->GetNext() );
+            {
+                rpPage = static_cast<SwPageFrame*>(rpPage->GetNext());
+            } while (rpPage->GetNext());
         }
         else
         {
-            OSL_ENSURE( mrpPage->GetNext(), "No new page?" );
-            mrpPage = static_cast<SwPageFrame*>(mrpPage->GetNext());
-            if ( mrpPage->IsEmptyPage() )
+            OSL_ENSURE( rpPage->GetNext(), "No new page?" );
+            rpPage = static_cast<SwPageFrame*>(rpPage->GetNext());
+            if (rpPage->IsEmptyPage())
             {
-                OSL_ENSURE( mrpPage->GetNext(), "No new page?" );
-                mrpPage = static_cast<SwPageFrame*>(mrpPage->GetNext());
+                OSL_ENSURE( rpPage->GetNext(), "No new page?" );
+                rpPage = static_cast<SwPageFrame*>(rpPage->GetNext());
             }
         }
-        mrpLay = mrpPage->FindBodyCont();
-        while( mrpLay->Lower() )
-            mrpLay = static_cast<SwLayoutFrame*>(mrpLay->Lower());
+        rpLay = rpPage->FindBodyCont();
+        while (rpLay->Lower())
+            rpLay = static_cast<SwLayoutFrame*>(rpLay->Lower());
         return true;
     }
     return false;
@@ -891,7 +897,7 @@ bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
             }
 
             SwPageFrame* pLastPage = mrpPage;
-            if( CheckInsertPage() )
+            if (CheckInsertPage(mrpPage, mrpLay, mrpFrame, mbBreakAfter, 
mnMaxParaPerPage < mnParagraphCnt))
             {
                 CheckFlyCache_( pLastPage );
                 if( mrpPrv && mrpPrv->IsTextFrame() && 
!mrpPrv->isFrameAreaSizeValid() )
diff --git a/sw/source/core/layout/layhelp.hxx 
b/sw/source/core/layout/layhelp.hxx
index 6dfa4b507639..36e3c71377d3 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -128,7 +128,8 @@ public:
     sal_uLong CalcPageCount();
     bool CheckInsert( sal_uLong nNodeIndex );
 
-    bool CheckInsertPage();
+    static bool CheckInsertPage(SwPageFrame *& rpPage, SwLayoutFrame *& rpLay,
+        SwFrame *& rpFrame, bool & rIsBreakAfter, bool const isForceBreak);
 
     /// Look for fresh text frames at this (new) page and set them to the right
     /// position, if they are in the fly cache.
diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 36f489e4b92c..698ac6a24015 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -36,6 +36,7 @@
 #include <colfrm.hxx>
 #include <tabfrm.hxx>
 #include <ftnfrm.hxx>
+#include "layhelp.hxx"
 #include <layouter.hxx>
 #include <dbg_lay.hxx>
 #include <viewopt.hxx>
@@ -2675,6 +2676,63 @@ void SwSectionFrame::Modify( const SfxPoolItem* pOld, 
const SfxPoolItem * pNew )
             pLowerFrame->InvalidateAll();
             pLowerFrame->InvalidateObjs(false);
         }
+        // Check if any page-breaks have been unhidden, create the new pages.
+        // Call IsHiddenNow() because a parent section could still hide.
+        if (!IsFollow() && IsInDocBody() && !IsInTab() && !IsHiddenNow())
+        {
+            SwViewShell *const pViewShell(getRootFrame()->GetCurrShell());
+            // no notification if SwViewShell is in construction
+            if (pViewShell && !pViewShell->IsInConstructor()
+                && pViewShell->GetLayout()
+                && pViewShell->GetLayout()->IsAnyShellAccessible())
+            {
+                auto pNext = FindNextCnt(true);
+                auto pPrev = FindPrevCnt();
+                pViewShell->InvalidateAccessibleParaFlowRelation(
+                    pNext ? dynamic_cast<SwTextFrame*>(pNext) : nullptr,
+                    pPrev ? dynamic_cast<SwTextFrame*>(pPrev) : nullptr );
+            }
+            SwSectionFrame * pFollow{this};
+            SwPageFrame * pPage{FindPageFrame()};
+            SwLayoutFrame * pLay{nullptr};
+            bool isBreakAfter{false};
+            SwFrame * pFirstOnPage{pPage->FindFirstBodyContent()};
+            while (pFirstOnPage->GetUpper()->IsInTab())
+            {
+                pFirstOnPage = pFirstOnPage->GetUpper();
+            }
+            assert(pFirstOnPage->IsContentFrame() || 
pFirstOnPage->IsTabFrame());
+            for (SwFrame* pLowerFrame = Lower(); pLowerFrame; pLowerFrame = 
pLowerFrame->GetNext())
+            {
+                if (pLowerFrame == pFirstOnPage)
+                {
+                    continue;
+                }
+                assert(pLowerFrame->IsContentFrame() || 
pLowerFrame->IsTabFrame());
+                if (SwLayHelper::CheckInsertPage(pPage, pLay, pLowerFrame, 
isBreakAfter, false))
+                {
+                    if (pLowerFrame == Lower())
+                    {   // move the whole section
+                        assert(pFollow == this);
+                        MoveSubTree(pLay, nullptr);
+                    }
+                    else
+                    {
+                        if (GetNext())
+                        {
+                            assert(GetNext()->IsFlowFrame());
+                            
SwFlowFrame::CastFlowFrame(GetNext())->MoveSubTree(pLay, nullptr);
+                        }
+                        pFollow = new SwSectionFrame(*pFollow, false);
+                        SimpleFormat();
+                        pFollow->InsertBehind(pLay, nullptr);
+                        pFollow->Init();
+                        
SwFlowFrame::CastFlowFrame(pLowerFrame)->MoveSubTree(pFollow, nullptr);
+                    }
+                }
+            }
+            CheckPageDescs(FindPageFrame());
+        }
     }
     else
         UpdateAttr_( pOld, pNew, nInvFlags );
commit a5eb4caa3a9b1df914bab3153cdd44fede25ebc4
Author:     Jan Holesovsky <[email protected]>
AuthorDate: Tue Aug 25 15:16:21 2020 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Fri Aug 30 15:28:48 2024 +0200

    CppunitTest_sw_htmlexport: The actual PNG data does not matter.
    
    The test was supposed to test whether the PNG data is embedded (or not),
    not the actual content of the data.  Turns out that a different zlib
    affects the PNG content, so let's ignore that part, and only check that
    the data is actually embedded.
    
    Change-Id: I603bd546d97abda7c47248db0a95349f4a48b4aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101329
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>
    (cherry picked from commit 824e092dbfefe2366f39e55a3efcc3d99dc1cbf7)

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 7a3c3aa7638b..18e96d62ed52 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -328,6 +328,8 @@ DECLARE_HTMLEXPORT_TEST(testNormalImageExport, 
"textAndImage.docx")
     CPPUNIT_ASSERT(pDoc);
 
     assertXPath(pDoc, "/html/body", 1);
+
+    // the HTML export normally does not embed the images
     OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
     CPPUNIT_ASSERT(imgSrc.endsWith(".png"));
 }
@@ -338,7 +340,13 @@ DECLARE_HTMLEXPORT_TEST(testEmbedImagesEnabled, 
"textAndImage.docx")
     CPPUNIT_ASSERT(pDoc);
 
     assertXPath(pDoc, "/html/body", 1);
-    assertXPath(pDoc, "/html/body/p/img", "src", 
"data:image/png;base64,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");
+
+    // the HTML export normally does not embed the images, but here the test
+    // name triggers setting of the "EmbedImages" filter option, meaning the
+    // image will not be a separate PNG, but an embedded base64 encoded
+    // version of that
+    OUString imgSrc = getXPath(pDoc, "/html/body/p/img", "src");
+    CPPUNIT_ASSERT(imgSrc.startsWith("data:image/png;base64,"));
 }
 
 DECLARE_HTMLEXPORT_TEST(testXHTML, "hello.html")

Reply via email to