dev/null                                  |binary
 include/oox/drawingml/shape.hxx           |    3 ---
 oox/source/drawingml/shape.cxx            |    2 --
 oox/source/drawingml/shapecontext.cxx     |    2 --
 oox/source/ppt/pptshape.cxx               |    4 ----
 sd/qa/unit/import-tests2.cxx              |   11 -----------
 sw/qa/extras/uiwriter/data/tdf130088.docx |binary
 sw/qa/extras/uiwriter/uiwriter6.cxx       |   27 +++++++++++++++++++++++++++
 sw/source/core/txtnode/txtedt.cxx         |    9 ++++++++-
 9 files changed, 35 insertions(+), 23 deletions(-)

New commits:
commit f0a9b44059f76f79ffddfdc012026ff2c592b5c1
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Fri Oct 27 09:43:44 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Nov 2 00:52:52 2023 +0100

    tdf#157937 sw: fix freezing of cycle case on tracked changes
    
    Add loop control to avoid never-ending iteration on selected
    text with tracked changes, where transliteration can result
    empty strings.
    
    Regression since commit 2d3c77e9b10f20091ef338e262ba7756eb280ce9
    "tdf#109266 sw change tracking: track transliteration".
    
    Change-Id: Ia5f92adfdda33562b4d1abe72c51134be8304639
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158525
    Tested-by: Jenkins
    Reviewed-by: László Németh <nem...@numbertext.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158535

diff --git a/sw/qa/extras/uiwriter/data/tdf130088.docx 
b/sw/qa/extras/uiwriter/data/tdf130088.docx
new file mode 100644
index 000000000000..8d5a7a604b5e
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf130088.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx 
b/sw/qa/extras/uiwriter/uiwriter6.cxx
index 73178363b8fb..edfc5c153afc 100644
--- a/sw/qa/extras/uiwriter/uiwriter6.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter6.cxx
@@ -662,6 +662,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf113790)
     CPPUNIT_ASSERT(dynamic_cast<SwXTextDocument*>(mxComponent.get()));
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157937)
+{
+    createSwDoc("tdf130088.docx");
+    SwDoc* pDoc = getSwDoc();
+    SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+    // select paragraph
+    pWrtShell->SelPara(nullptr);
+
+    // enable redlining
+    dispatchCommand(mxComponent, ".uno:TrackChanges", {});
+    CPPUNIT_ASSERT_MESSAGE("redlining should be on",
+                           pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+
+    // show changes
+    CPPUNIT_ASSERT_MESSAGE(
+        "redlines should be visible",
+        
IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags()));
+
+    // cycle case with change tracking
+    dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+    dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+
+    // This resulted freezing
+    dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {});
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108048)
 {
     createSwDoc();
diff --git a/sw/source/core/txtnode/txtedt.cxx 
b/sw/source/core/txtnode/txtedt.cxx
index 71ee1fd93a24..2f3e7aa6db86 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1973,6 +1973,7 @@ void SwTextNode::TransliterateText(
 
         sal_Int32 nEndPos = 0;
         LanguageType nLang = LANGUAGE_NONE;
+        sal_Int32 nLoopControlRuns = 0;
         do {
             if( pIter )
             {
@@ -2005,7 +2006,13 @@ void SwTextNode::TransliterateText(
             }
 
             nStt = nEndPos;
-        } while( nEndPos < nEnd && pIter && pIter->Next() );
+
+            // tdf#157937 selection containing tracked changes needs loop 
control:
+            // stop looping, if there are too much empty transliterations
+            if ( sChgd.isEmpty() )
+                ++nLoopControlRuns;
+
+        } while( nEndPos < nEnd && pIter && pIter->Next() && nLoopControlRuns 
< 100 );
     }
 
     if (aChanges.empty())
commit 5879d4d242fb9b4227de068aa1adc3621e190754
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon Oct 23 15:34:58 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Nov 2 00:52:44 2023 +0100

    tdf#157679: Revert "pptx: import shape text from master page"
    
    This reverts commit ae3b97a69688553e6c40ef4b64655db09d5a0f5e.
    
    Change-Id: I39fd84b5efbff0a2cafe090f4f866c801cef19b4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158357
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 3b37c5fa7dce7718b566ad4f4fe80191b64cd533)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158544

diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx
index 4c8be792e7f6..ccf477bef805 100644
--- a/include/oox/drawingml/shape.hxx
+++ b/include/oox/drawingml/shape.hxx
@@ -237,8 +237,6 @@ public:
     void                setTxbxHasLinkedTxtBox( const bool rhs){ 
mbHasLinkedTxbx = rhs; };
     const LinkedTxbxAttr&     getLinkedTxbxAttributes() const { return 
maLinkedTxbxAttr; };
     bool                isLinkedTxbx() const { return mbHasLinkedTxbx; };
-    void                setHasCustomPrompt(bool bValue) { mbHasCustomPrompt = 
bValue; }
-    bool                hasCustomPrompt() { return mbHasCustomPrompt; }
 
     void setZOrder(sal_Int32 nZOrder) { mnZOrder = nZOrder; }
 
@@ -395,7 +393,6 @@ private:
     bool mbTextBox; ///< This shape has a textbox.
     LinkedTxbxAttr                  maLinkedTxbxAttr;
     bool                            mbHasLinkedTxbx; // this text box has 
linked text box ?
-    bool                            mbHasCustomPrompt; // indicates that it's 
not a generic placeholder
 
     css::uno::Sequence<css::beans::PropertyValue> maDiagramDoms;
 
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 78b50294d356..cbfc2dae2dca 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -150,7 +150,6 @@ Shape::Shape( const char* pServiceName, bool bDefaultHeight 
)
 , mbWps( false )
 , mbTextBox( false )
 , mbHasLinkedTxbx( false )
-, mbHasCustomPrompt( false )
 , maDiagramDoms( 0 )
 , mpDiagramHelper( nullptr )
 {
@@ -195,7 +194,6 @@ Shape::Shape( const ShapePtr& pSourceShape )
 , mbWps( pSourceShape->mbWps )
 , mbTextBox( pSourceShape->mbTextBox )
 , mbHasLinkedTxbx(false)
-, mbHasCustomPrompt( pSourceShape->mbHasCustomPrompt )
 , maDiagramDoms( pSourceShape->maDiagramDoms )
 , mnZOrder(pSourceShape->mnZOrder)
 , mnZOrderOff(pSourceShape->mnZOrderOff)
diff --git a/oox/source/drawingml/shapecontext.cxx 
b/oox/source/drawingml/shapecontext.cxx
index 3375f6f6dddd..289cda8dfd66 100644
--- a/oox/source/drawingml/shapecontext.cxx
+++ b/oox/source/drawingml/shapecontext.cxx
@@ -89,8 +89,6 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 
aElementToken, const
         mpShapePtr->setSubType( rAttribs.getToken( XML_type, XML_obj ) );
         if( rAttribs.hasAttribute( XML_idx ) )
             mpShapePtr->setSubTypeIndex( rAttribs.getInteger( XML_idx, 0 ) );
-        if( rAttribs.hasAttribute( XML_hasCustomPrompt ) )
-            mpShapePtr->setHasCustomPrompt( rAttribs.getBool( 
XML_hasCustomPrompt, false ) );
         break;
     // nvSpPr CT_ShapeNonVisual end
 
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 9634d44e83fe..4ed668367a1e 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -457,10 +457,6 @@ void PPTShape::addShape(
                 Reference < XText > xText(mxShape, UNO_QUERY);
                 if (xText.is())
                 {
-                    if (mpPlaceholder && mpPlaceholder->getTextBody() && 
!mpPlaceholder->getTextBody()->isEmpty()
-                        && mpPlaceholder->hasCustomPrompt())
-                        
xText->setString(mpPlaceholder->getTextBody()->toString());
-
                     TextCharacterProperties aCharStyleProperties;
                     getTextBody()->ApplyStyleEmpty(rFilterBase, xText, 
aCharStyleProperties, mpMasterTextListStyle);
                 }
diff --git a/sd/qa/unit/data/pptx/shape-master-text.pptx 
b/sd/qa/unit/data/pptx/shape-master-text.pptx
deleted file mode 100644
index ca056b852d3a..000000000000
Binary files a/sd/qa/unit/data/pptx/shape-master-text.pptx and /dev/null differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 0ca3513ae00c..44eacbf1da05 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1904,17 +1904,6 @@ CPPUNIT_TEST_FIXTURE(SdImportTest2, 
testOverflowBehaviorClip)
     }
 }
 
-CPPUNIT_TEST_FIXTURE(SdImportTest2, testShapeMasterText)
-{
-    createSdImpressDoc("pptx/shape-master-text.pptx");
-    uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0));
-
-    uno::Reference<text::XTextRange> const xParagraph(getParagraphFromShape(0, 
xShape));
-
-    uno::Reference<text::XTextRange> xRun(getRunFromParagraph(0, xParagraph));
-    CPPUNIT_ASSERT_EQUAL(OUString("Custom"), xRun->getString());
-}
-
 CPPUNIT_TEST_FIXTURE(SdImportTest2, testIndentDuplication)
 {
     createSdImpressDoc("pptx/formatting-bullet-indent.pptx");

Reply via email to