[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 10 commits - cui/source download.lst external/curl include/svl officecfg/registry sc/source sfx2/source svl/source sw/qa sw/source vcl/qt5 writerfilter/source

Eike Rathke (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 4 08:13:12 UTC 2020


 cui/source/dialogs/SpellDialog.cxx                         |   58 ++++++++----
 cui/source/inc/SpellDialog.hxx                             |    5 -
 download.lst                                               |    4 
 external/curl/ExternalPackage_curl.mk                      |    2 
 external/curl/ExternalProject_curl.mk                      |    1 
 external/curl/clang-cl.patch.0                             |    4 
 external/curl/curl-msvc.patch.1                            |    8 -
 include/svl/zforlist.hxx                                   |   13 ++
 officecfg/registry/schema/org/openoffice/Office/Writer.xcs |   12 ++
 sc/source/core/tool/interpr2.cxx                           |    2 
 sfx2/source/doc/objmisc.cxx                                |    5 +
 svl/source/numbers/zforfind.cxx                            |   19 ++--
 svl/source/numbers/zforfind.hxx                            |    8 +
 svl/source/numbers/zforlist.cxx                            |    5 -
 svl/source/numbers/zformat.cxx                             |    2 
 sw/qa/core/txtnode/data/textbox-copy-anchor.docx           |binary
 sw/qa/core/txtnode/txtnode.cxx                             |   28 ++++++
 sw/qa/extras/ooxmlexport/data/tdf134063.docx               |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                   |   29 ++++--
 sw/qa/extras/ooxmlexport/ooxmlexport13.cxx                 |   49 +++++++++-
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx                  |   36 ++++++-
 sw/qa/extras/ooxmlexport/ooxmlexport8.cxx                  |   36 ++++++-
 sw/source/core/doc/DocumentContentOperationsManager.cxx    |    8 +
 sw/source/core/text/txtfld.cxx                             |   13 +-
 sw/source/core/text/txttab.cxx                             |   15 +--
 sw/source/core/txtnode/atrflyin.cxx                        |   10 ++
 sw/source/core/undo/undobj.cxx                             |    4 
 vcl/qt5/Qt5Frame.cxx                                       |    3 
 writerfilter/source/dmapper/SdtHelper.cxx                  |   60 +++++++++----
 29 files changed, 338 insertions(+), 101 deletions(-)

New commits:
commit 537a0e9f102ee8d67c4d50e9771bdb863e31a9e6
Author:     Eike Rathke <erack at redhat.com>
AuthorDate: Thu Jul 2 20:49:56 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    Resolves: tdf#134455 Let TIMEVALUE() use lax time recognition
    
    ... to accept minutes or seconds >59
    
    Prepare SvNumInputOptions as enum class in case further options
    would be needed for anything else.
    
    Change-Id: Ie9ae62adf68f9948e23f55ac32c09a6b992a36e2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97784
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit f106bb4471b6d3627311980ed727459b2da8e448)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97793
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index 5839c7faa636..8091c2faea71 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -373,6 +373,16 @@ public:
 
 typedef std::vector< OUString > NfWSStringsDtor;
 
+/** Input options to be used with IsNumberFormat() */
+enum class SvNumInputOptions : sal_uInt16
+{
+    NONE = 0,
+    LAX_TIME = 1    ///< allow input of minutes or seconds >59
+};
+namespace o3tl {
+    template<> struct typed_flags<SvNumInputOptions> : is_typed_flags<SvNumInputOptions, 0x0001> {};
+}
+
 class SvNumberFormatterRegistry_Impl;
 class NfCurrencyTable;
 
@@ -532,7 +542,8 @@ public:
                 returned in fOutNumber
             <FALSE/> if input is not a number
      */
-    bool IsNumberFormat( const OUString& sString, sal_uInt32& F_Index, double& fOutNumber );
+    bool IsNumberFormat( const OUString& sString, sal_uInt32& F_Index, double& fOutNumber,
+                         SvNumInputOptions eInputOptions = SvNumInputOptions::NONE );
 
     /// Format a number according to a format index, return string and color
     void GetOutputString( const double& fOutNumber, sal_uInt32 nFIndex,
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index d6c76315b8fd..eeb59550105f 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -935,7 +935,7 @@ void ScInterpreter::ScGetTimeValue()
     OUString aInputString = GetString().getString();
     sal_uInt32 nFIndex = 0;                 // damit default Land/Spr.
     double fVal;
-    if (pFormatter->IsNumberFormat(aInputString, nFIndex, fVal))
+    if (pFormatter->IsNumberFormat(aInputString, nFIndex, fVal, SvNumInputOptions::LAX_TIME))
     {
         SvNumFormatType eType = pFormatter->GetType(nFIndex);
         if (eType == SvNumFormatType::TIME || eType == SvNumFormatType::DATETIME)
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index cd889ce4d9d6..ad42df620743 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -949,7 +949,9 @@ inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j )
 
 bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
                                        sal_uInt16 nIndex, // j-value of the first numeric time part of input, default 0
-                                       sal_uInt16 nCnt ) const // count of numeric time parts
+                                       sal_uInt16 nCnt,   // count of numeric time parts
+                                       SvNumInputOptions eInputOptions
+                                     ) const
 {
     bool bRet = true;
     sal_uInt16 nHour;
@@ -998,13 +1000,15 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
     else if (nIndex - nStartIndex < nCnt)
     {
         nMinute = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
-        if (nIndex > 1 && nMinute > 59)
+        if (!(eInputOptions & SvNumInputOptions::LAX_TIME)
+                && nIndex > 1 && nMinute > 59)
             bRet = false;   // 1:60 or 1:123 is invalid, 123:1 is valid
     }
     if (nIndex - nStartIndex < nCnt)
     {
         nSecond = static_cast<sal_uInt16>(sStrArray[nNums[nIndex++]].toInt32());
-        if (nIndex > 1 && nSecond > 59 && !(nHour == 23 && nMinute == 59 && nSecond == 60))
+        if (!(eInputOptions & SvNumInputOptions::LAX_TIME)
+                && nIndex > 1 && nSecond > 59 && !(nHour == 23 && nMinute == 59 && nSecond == 60))
             bRet = false;   // 1:60 or 1:123 or 1:1:123 is invalid, 123:1 or 123:1:1 is valid, or leap second
     }
     if (nIndex - nStartIndex < nCnt)
@@ -3649,9 +3653,10 @@ void ImpSvNumberInputScan::ChangeNullDate( const sal_uInt16 Day,
  * Does rString represent a number (also date, time et al)
  */
 bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString,         // string to be analyzed
-                                           SvNumFormatType& F_Type,                   // IN: old type, OUT: new type
+                                           SvNumFormatType& F_Type,         // IN: old type, OUT: new type
                                            double& fOutNumber,              // OUT: number if convertible
-                                           const SvNumberformat* pFormat )  // maybe a number format to match against
+                                           const SvNumberformat* pFormat,   // maybe a number format to match against
+                                           SvNumInputOptions eInputOptions )
 {
     OUString aString;
     bool res; // return value
@@ -4052,7 +4057,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString,         // s
             break;
 
         case SvNumFormatType::TIME:
-            res = GetTimeRef(fOutNumber, 0, nNumericsCnt);
+            res = GetTimeRef(fOutNumber, 0, nNumericsCnt, eInputOptions);
             if ( nSign < 0 )
             {
                 fOutNumber = -fOutNumber;
@@ -4068,7 +4073,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString,         // s
             if ( res )
             {
                 double fTime;
-                res = GetTimeRef( fTime, k, nNumericsCnt - k );
+                res = GetTimeRef( fTime, k, nNumericsCnt - k, eInputOptions);
                 fOutNumber += fTime;
             }
             break;
diff --git a/svl/source/numbers/zforfind.hxx b/svl/source/numbers/zforfind.hxx
index 1efeb215619b..332f0ef6ef94 100644
--- a/svl/source/numbers/zforfind.hxx
+++ b/svl/source/numbers/zforfind.hxx
@@ -46,9 +46,10 @@ public:
 
     /// convert input string to number
     bool IsNumberFormat( const OUString& rString,            /// input string
-                         SvNumFormatType& F_Type,                      /// format type (in + out)
+                         SvNumFormatType& F_Type,            /// format type (in + out)
                          double& fOutNumber,                 /// value determined (out)
-                         const SvNumberformat* pFormat);     /// number format to which compare against
+                         const SvNumberformat* pFormat,      /// number format to which compare against
+                         SvNumInputOptions eInputOptions);
 
     /// after IsNumberFormat: get decimal position
     short   GetDecPos() const { return nDecPos; }
@@ -321,7 +322,8 @@ private:
      */
     bool GetTimeRef( double& fOutNumber,                     // result as double
                      sal_uInt16 nIndex,                      // Index of hour in input
-                     sal_uInt16 nCnt ) const;                // Count of time substrings in input
+                     sal_uInt16 nCnt,                        // Count of time substrings in input
+                     SvNumInputOptions eInputOptions ) const;
     sal_uInt16 ImplGetDay  ( sal_uInt16 nIndex ) const;      // Day input, 0 if no match
     sal_uInt16 ImplGetMonth( sal_uInt16 nIndex ) const;      // Month input, zero based return, NumberOfMonths if no match
     sal_uInt16 ImplGetYear ( sal_uInt16 nIndex );   // Year input, 0 if no match
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index fd885ac0e16d..5fd5a1e7c825 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -1123,7 +1123,8 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable(
 
 bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
                                        sal_uInt32& F_Index,
-                                       double& fOutNumber)
+                                       double& fOutNumber,
+                                       SvNumInputOptions eInputOptions)
 {
     ::osl::MutexGuard aGuard( GetInstanceMutex() );
 
@@ -1161,7 +1162,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString,
     }
     else
     {
-        res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat);
+        res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat, eInputOptions);
     }
     if (res && !IsCompatible(FType, RType))     // non-matching type
     {
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 01eb9c319d92..23c0919aecf2 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -855,7 +855,7 @@ SvNumberformat::SvNumberformat(OUString& rString,
                     {
                         sal_Int32 nDecPos;
                         SvNumFormatType F_Type = SvNumFormatType::UNDEFINED;
-                        if (!pISc->IsNumberFormat(sStr, F_Type, fNumber, nullptr) ||
+                        if (!pISc->IsNumberFormat(sStr, F_Type, fNumber, nullptr, SvNumInputOptions::NONE) ||
                             ( F_Type != SvNumFormatType::NUMBER &&
                               F_Type != SvNumFormatType::SCIENTIFIC) )
                         {
commit 49f31495b98f386bd9ae2eb30352c413cb9ac89d
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Tue Jun 30 17:41:53 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    tdf#132172 Qt5 just handle visible widget's focus
    
    I investigated the state of isWindow() and the SalFrameToTop
    flags for the detached find toolbar (tdf#126607) and the Impress
    presentation and the tabbed "page size" drop-down and all had the
    same status (isWin: 1, flags: 12). Than I had a look at the gtk3
    implementation, which just handles focus requests, if the widget
    is already mapped (gtk_widget_get_mapped).
    
    So I also dumped the visibility as the nearest equivalent in Qt to
    the X11 mapped state, and that was different. In the end Qt now
    also just handles the focus for already visible widgets, like
    gtk3, which works for all the cases I tested (incl. tdf#125517).
    
    And omiting either activateWindow or setFocus breaks some cases...
    and I still don't understand the GrabFocusOnly flag, which is just
    handled in the X11 backends at all...
    
    Note: this doesn't happen with 7.0+, because the weld'ed version
    of that control (commit 3afc718eddcd81232392d46fccc24b8ec626c8df
    "rework PageSizePopup to be a PopupWindowController") doesn't
    expose this bug (and also doesn't support mouse-over highlight).
    
    Change-Id: Id085732f6a52bbc69ed47fbd3d57454756a03121
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97549
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
    (cherry picked from commit 06fb3e7b7f1079c276ad2f048cd94299b4bd7006)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97575

diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index b38b92f143c9..25be0a1a4bc9 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -758,7 +758,8 @@ void Qt5Frame::ToTop(SalFrameToTop nFlags)
         pWidget->raise();
     if ((nFlags & SalFrameToTop::RestoreWhenMin) || (nFlags & SalFrameToTop::ForegroundTask))
         pWidget->activateWindow();
-    else if ((nFlags & SalFrameToTop::GrabFocus) || (nFlags & SalFrameToTop::GrabFocusOnly))
+    else if ((nFlags & (SalFrameToTop::GrabFocus | SalFrameToTop::GrabFocusOnly))
+             && pWidget->isVisible())
     {
         pWidget->activateWindow();
         pWidget->setFocus();
commit 3a10deef29b571ca5949614f5d6c768f635afd0d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jun 8 21:22:58 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    tdf#128006 allow documents inside odbs to be as trusted as their container
    
    Change-Id: Id19d3805ef2e3282c1a8e89dd8edcccbf4ac4db6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96210
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit ac65ade24aa10c0a39d7d38576ad54bd00724455)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97496
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 25db3d85238e..681940462720 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1763,7 +1763,12 @@ OUString SfxObjectShell_Impl::getDocumentLocation() const
             // for documents made from a template: get the name of the template
             sLocation = rDocShell.getDocProperties()->getTemplateURL();
         }
+
+        // tdf#128006 take document base url as location
+        if (sLocation.isEmpty())
+            sLocation = rDocShell.getDocumentBaseURL();
     }
+
     return sLocation;
 }
 
commit c30dc7888673ccd1fed33bffc0f4a6b0da594d0a
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Jun 29 21:05:27 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    tdf#134099 sw: fix textbox anchors on copy-paste and undo
    
    Regression from commit c7307c77254557646f33017af915f6808a861e29
    (fdo#82191 sw::DocumentLayoutManager: copy textbox content of draw
    formats, 2014-08-15), without which this problem gets hidden, as copy
    breaks the textbox into 2 pieces, so the textbox codepaths are no longer
    hit.
    
    The direct problem is that SwHistorySetFormat::SetInDoc() uses a raw
    node index into the nodes array, which is past the end of the nodes
    array.
    
    Root cause is that we have this invariant that actions and their undo
    has to be in sync, otherwise raw node indexes no longer work. In this
    case, SwUndoSaveContent::DelContentIndex() did not delete a fly frame
    format, because it was out of range, as it had a wrong anchor.
    
    Fix this in SwTextFlyCnt::SetAnchor(), so that whenever the anchor of a
    draw format is set via that function, we update its textbox as well.
    
    Also fix a related problem when fly formats were copied twice.
    
    (cherry picked from commit 682e0488df819c191c13a03758fad0690706e508)
    
    Conflicts:
            sw/qa/core/txtnode/txtnode.cxx
    
    Change-Id: I0d6c9069544c405eb20c5fed65fb40423b0adc84
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97515
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/core/txtnode/data/textbox-copy-anchor.docx b/sw/qa/core/txtnode/data/textbox-copy-anchor.docx
new file mode 100644
index 000000000000..b835097f1b9b
Binary files /dev/null and b/sw/qa/core/txtnode/data/textbox-copy-anchor.docx differ
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index b6af5230faf8..c23272285569 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -49,6 +49,34 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testBtlrCellChinese)
     assertXPath(pXmlDoc, "//font[1]", "vertical", "false");
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxCopyAnchor)
+{
+    load(DATA_DIRECTORY, "textbox-copy-anchor.docx");
+    SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+    SwDocShell* pShell = pTextDoc->GetDocShell();
+    SwWrtShell* pWrtShell = pShell->GetWrtShell();
+    SwDoc aClipboard;
+    pWrtShell->SelAll();
+    pWrtShell->Copy(&aClipboard);
+    pWrtShell->SttEndDoc(/*bStart=*/false);
+    pWrtShell->Paste(&aClipboard);
+
+    const SwFrameFormats& rFormats = *pShell->GetDoc()->GetSpzFrameFormats();
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 4
+    // - Actual  : 6
+    // i.e. 2 fly frames were copied twice.
+    CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), rFormats.size());
+
+    SwPosition aDrawAnchor1 = *rFormats[0]->GetAnchor().GetContentAnchor();
+    SwPosition aFlyAnchor1 = *rFormats[1]->GetAnchor().GetContentAnchor();
+    CPPUNIT_ASSERT_EQUAL(aFlyAnchor1.nNode, aDrawAnchor1.nNode);
+    SwPosition aDrawAnchor2 = *rFormats[2]->GetAnchor().GetContentAnchor();
+    SwPosition aFlyAnchor2 = *rFormats[3]->GetAnchor().GetContentAnchor();
+    // This also failed, aFlyAnchor2 was wrong, as it got out of sync with aDrawAnchor2.
+    CPPUNIT_ASSERT_EQUAL(aFlyAnchor2.nNode, aDrawAnchor2.nNode);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 08d7eb6f09fa..f62d77352cc9 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3785,6 +3785,14 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
             }
         }
 
+        // Ignore TextBoxes, they are already handled in
+        // sw::DocumentLayoutManager::CopyLayoutFormat().
+        if (SwTextBoxHelper::isTextBox(it->GetFormat(), RES_FLYFRMFMT))
+        {
+            it = aSet.erase(it);
+            continue;
+        }
+
         // Copy the format and set the new anchor
         aVecSwFrameFormat.push_back( pDest->getIDocumentLayoutAccess().CopyLayoutFormat( *(*it).GetFormat(),
                 aAnchor, false, true ) );
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 1509c0cf3d40..837c90a1a5a7 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -35,6 +35,7 @@
 #include <objectformatter.hxx>
 #include <calbck.hxx>
 #include <dcontact.hxx>
+#include <textboxhelper.hxx>
 
 SwFormatFlyCnt::SwFormatFlyCnt( SwFrameFormat *pFrameFormat )
     : SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -202,6 +203,15 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
             }
         }
         pFormat->SetFormatAttr( aAnchor );  // only set the anchor
+
+        // If the draw format has a TextBox, then set its anchor as well.
+        if (SwFrameFormat* pTextBox
+            = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_DRAWFRMFMT))
+        {
+            SwFormatAnchor aTextBoxAnchor(pTextBox->GetAnchor());
+            aTextBoxAnchor.SetAnchor(aAnchor.GetContentAnchor());
+            pTextBox->SetFormatAttr(aTextBoxAnchor);
+        }
     }
 
     // The node may have several SwTextFrames - for every SwTextFrame a
commit 5658fafa31b407c42fb109b5467df8e8f76e8c45
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Wed Jun 17 13:42:37 2020 +0300
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    tdf#134063: sw: redesigned support for tab at zero position
    
    Initial support for tab position at zero (d2e428d1) was not
    taking into account hack for tab positions below zero. So
    previous behavior is restored (search is started from 0) but
    we also taking into account potential tabs at zero position
    in SwLineInfo::GetTabStop()
    
    Change-Id: I8b315ab69f9a53ac15002a41a81e069ff832f692
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96526
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 02c0e015f84ddcc6fa94433f603ef89f358a0391)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96582
    Reviewed-by: Vasily Melenchuk <vasily.melenchuk at cib.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97478
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf134063.docx b/sw/qa/extras/ooxmlexport/data/tdf134063.docx
new file mode 100644
index 000000000000..372fed20e57f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf134063.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index a5fdaa159d9e..94103ce59e1e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -393,6 +393,18 @@ DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak3, "tdf123636_newlinePage
     assertXPath(pDump, "/root/page[1]/body/txt[3]/Text[1]", "Portion", "Last line on page 1");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
+{
+    CPPUNIT_ASSERT_EQUAL(2, getPages());
+
+    xmlDocPtr pDump = parseLayoutDump();
+
+    // There are three tabs with default width
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[1]", "nWidth").toInt32());
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[2]", "nWidth").toInt32());
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(720), getXPath(pDump, "//page[1]/body/txt[1]/Text[3]", "nWidth").toInt32());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf123636_newlinePageBreak4, "tdf123636_newlinePageBreak4.docx")
 {
     //MS Compatibility flag: SplitPgBreakAndParaMark
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 37b00c532bae..63c253b0d0d7 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -51,6 +51,11 @@ const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos, const SwTwip
         if( rTabStop.GetTabPos() > SwTwips(nRight) )
             return i ? nullptr : &rTabStop;
 
+        // If we are starting search from zero position,
+        // than we should include tabstop at zero position
+        if ((nSearchPos == 0) && (rTabStop.GetTabPos() == 0))
+            return &rTabStop;
+
         if( rTabStop.GetTabPos() > nSearchPos )
             return &rTabStop;
     }
@@ -122,7 +127,7 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
 
         // #i24363# tab stops relative to indent
         // nSearchPos: The current position relative to the tabs origin
-        SwTwips nSearchPos = bRTL ?
+        const SwTwips nSearchPos = bRTL ?
                                    nTabLeft - nCurrentAbsPos :
                                    nCurrentAbsPos - nTabLeft;
 
@@ -130,14 +135,6 @@ SwTabPortion *SwTextFormatter::NewTabPortion( SwTextFormatInfo &rInf, bool bAuto
         // any hard set tab stops:
         // Note: If there are no user defined tab stops, there is always a
         // default tab stop.
-
-        // If search is started from zero position (beginning of line), than
-        // lets do it from -1: this will allow to include into account potential
-        // tab stop at zero position. Yes, it will be zero width tab useless
-        // mostly, but this have sense in case of lists.
-        if (nSearchPos == 0)
-            nSearchPos = -1;
-
         const SvxTabStop* pTabStop = m_aLineInf.GetTabStop( nSearchPos, nMyRight );
         if ( pTabStop )
         {
commit dd226bf9b8370e9bfa2b14d02ca779b1e01c80c6
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Jun 29 14:00:56 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:33 2020 +0100

    curl: upgrade to release 7.71.0
    
    Fixes CVE-2020-8169, and about 3 other ones that don't affect LO/libcmis.
    
    Disable new optional dependencies "ngtcp2" and "quiche".
    
    Change-Id: I595ed909c4e792ac3244643511a338b117e7f102
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97406
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit cb0c7e26e5708010b1fe941ae2f66134f31ed876)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97386
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/download.lst b/download.lst
index 8308186ef5cd..97dcad75633f 100644
--- a/download.lst
+++ b/download.lst
@@ -29,8 +29,8 @@ export CPPUNIT_SHA256SUM := 3d569869d27b48860210c758c4f313082103a5e58219a7669b52
 export CPPUNIT_TARBALL := cppunit-1.14.0.tar.gz
 export CT2N_SHA256SUM := 71b238efd2734be9800af07566daea8d6685aeed28db5eb5fa0e6453f4d85de3
 export CT2N_TARBALL := 1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt
-export CURL_SHA256SUM := 7766d263929404f693905b5e5222aa0f2bdf8c66ab4b8758f0c0820a42b966cd
-export CURL_TARBALL := curl-7.65.0.tar.xz
+export CURL_SHA256SUM := cdf18794393d8bead915312708a9e5d819c6e9919de14b20d5c8e7987abd9772
+export CURL_TARBALL := curl-7.71.0.tar.xz
 export EBOOK_SHA256SUM := 7e8d8ff34f27831aca3bc6f9cc532c2f90d2057c778963b884ff3d1e34dfe1f9
 export EBOOK_TARBALL := libe-book-0.1.3.tar.xz
 export EPOXY_SHA256SUM := 002958c5528321edd53440235d3c44e71b5b1e09b9177e8daf677450b6c4433d
diff --git a/external/curl/ExternalPackage_curl.mk b/external/curl/ExternalPackage_curl.mk
index 56c418b6ef0c..8da569e3e0cf 100644
--- a/external/curl/ExternalPackage_curl.mk
+++ b/external/curl/ExternalPackage_curl.mk
@@ -20,7 +20,7 @@ $(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.4.dyli
 else ifeq ($(OS),AIX)
 $(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so,lib/.libs/libcurl.so.4))
 else
-$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.5.0))
+$(eval $(call gb_ExternalPackage_add_file,curl,$(LIBO_LIB_FOLDER)/libcurl.so.4,lib/.libs/libcurl.so.4.6.0))
 endif
 
 endif # $(DISABLE_DYNLOADING)
diff --git a/external/curl/ExternalProject_curl.mk b/external/curl/ExternalProject_curl.mk
index 366ff1e39d95..5cbedac82d1a 100644
--- a/external/curl/ExternalProject_curl.mk
+++ b/external/curl/ExternalProject_curl.mk
@@ -48,6 +48,7 @@ $(call gb_ExternalProject_get_state_target,curl,build):
 			--without-libidn2 --without-libpsl --without-librtmp \
 			--without-libssh2 --without-metalink --without-nghttp2 \
 			--without-libssh --without-brotli \
+			--without-ngtcp2 --without-quiche \
 			--disable-ares \
 			--disable-dict --disable-file --disable-gopher --disable-imap \
 			--disable-ldap --disable-ldaps --disable-manual --disable-pop3 \
diff --git a/external/curl/clang-cl.patch.0 b/external/curl/clang-cl.patch.0
index 2f7fe567460c..2fbb10c2a9aa 100644
--- a/external/curl/clang-cl.patch.0
+++ b/external/curl/clang-cl.patch.0
@@ -4,8 +4,8 @@
  !ELSE
  CC_NODEBUG  = $(CC) /O2 /DNDEBUG
  CC_DEBUG    = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
--CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL $(SOLARINC)
-+CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /c /DBUILDING_LIBCURL $(SOLARINC)
+-CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL $(SOLARINC)
++CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /c /DBUILDING_LIBCURL $(SOLARINC)
  !ENDIF
  
  LFLAGS     = /nologo /machine:$(MACHINE)
diff --git a/external/curl/curl-msvc.patch.1 b/external/curl/curl-msvc.patch.1
index 80160958c99d..a5b79a8e9c49 100644
--- a/external/curl/curl-msvc.patch.1
+++ b/external/curl/curl-msvc.patch.1
@@ -6,8 +6,8 @@ MSVC: using SOLARINC
  !ELSE
  CC_NODEBUG  = $(CC) /O2 /DNDEBUG
  CC_DEBUG    = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd
--CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
-+CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /wd4127 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL $(SOLARINC)
+-CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL
++CFLAGS      = /I. /I ../lib /I../include /nologo /W4 /EHsc /DWIN32 /FD /c /DBUILDING_LIBCURL $(SOLARINC)
  !ENDIF
  
  LFLAGS     = /nologo /machine:$(MACHINE)
@@ -18,10 +18,10 @@ MSVC: using SOLARINC
 -RC_FLAGS = /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
 +RC_FLAGS = $(SOLARINC) /dDEBUGBUILD=1 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
  CURL_CC       = $(CC_DEBUG) $(RTLIB_DEBUG)
- CURL_RC_FLAGS = /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc
+ CURL_RC_FLAGS = $(CURL_RC_FLAGS) /i../include /dDEBUGBUILD=1 /Fo $@ $(CURL_SRC_DIR)\curl.rc
  !ELSE
 -RC_FLAGS = /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
 +RC_FLAGS = $(SOLARINC) /dDEBUGBUILD=0 /Fo $@ $(LIBCURL_SRC_DIR)\libcurl.rc
  CURL_CC       = $(CC_NODEBUG) $(RTLIB)
- CURL_RC_FLAGS = /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc
+ CURL_RC_FLAGS = $(CURL_RC_FLAGS) /i../include /dDEBUGBUILD=0 /Fo $@ $(CURL_SRC_DIR)\curl.rc
  !ENDIF
commit c22f696cae30855f6103a82c29c6073bdbc83312
Author:     Serge Krot <Serge.Krot at cib.de>
AuthorDate: Tue Jun 16 17:11:12 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:32 2020 +0100

    tdf#134043 DOCX import: DropDown text field instead of ComboBox form control
    
    Change-Id: Ide9cedefde3b00fa0eeb37a6540e8d4a420b70c0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96471
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96608

diff --git a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
index 596ce4886b66..fd5f6b4539b2 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Writer.xcs
@@ -5883,6 +5883,18 @@
             <value>true</value>
           </prop>
         </group>
+        <group oor:name="DOCX">
+          <info>
+            <desc>Contains settings for importing DOCX.</desc>
+          </info>
+          <prop oor:name="ImportComboBoxAsDropDown" oor:type="xs:boolean" oor:nillable="false">
+            <info>
+              <desc>Specifies whether ComboBox form control should be imported as DropDown text field.</desc>
+              <label>Import ComboBox as DropDown</label>
+            </info>
+            <value>false</value>
+          </prop>
+        </group>
       </group>
     </group>
     <group oor:name="Numbering">
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d4a453a27580..9a771a5f81b7 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -272,13 +272,30 @@ DECLARE_OOXMLEXPORT_TEST(testDropdownInCell, "dropdown-in-cell.docx")
     uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount());
 
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+
     // Second problem: dropdown shape wasn't anchored inside the B1 cell.
-    uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xAnchor = xShape->getAnchor();
-    uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
-    uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY);
-    uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xCell, uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+    if (xDrawPage->getCount() > 0)
+    {
+        uno::Reference<text::XTextContent> xShape(getShape(1), uno::UNO_QUERY);
+        uno::Reference<text::XTextRange> xAnchor = xShape->getAnchor();
+        uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+        uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY);
+        uno::Reference<text::XTextRangeCompare> xTextRangeCompare(xCell, uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(sal_Int16(0), xTextRangeCompare->compareRegionStarts(xAnchor, xCell));
+    }
+    else
+    {
+        // ComboBox was imported as DropDown text field
+        uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+        uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+        CPPUNIT_ASSERT(xFields->hasMoreElements());
+        uno::Any aField = xFields->nextElement();
+        uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
+        CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+    }
 }
 
 DECLARE_OOXMLEXPORT_TEST(testTableAlignment, "table-alignment.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index d2765488b797..a5fdaa159d9e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -505,7 +505,12 @@ DECLARE_OOXMLEXPORT_TEST(testParaAdjustDistribute, "para-adjust-distribute.docx"
 
 DECLARE_OOXMLEXPORT_TEST(testInputListExport, "tdf122186_input_list.odt")
 {
-    if (!mbExported) // importing the ODT, an input field
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+
+    if (!mbExported || xDrawPage->getCount() == 0) // importing the ODT, an input field
     {
         uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
         uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
@@ -859,12 +864,32 @@ DECLARE_OOXMLEXPORT_TEST(tdf127085, "tdf127085.docx")
 
 DECLARE_OOXMLEXPORT_TEST(tdf119809, "tdf119809.docx")
 {
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+
     // Combobox without an item list lost during import
-    uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
-    uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
-    uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox")));
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength());
+    if (xDrawPage->getCount() > 0)
+    {
+        uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
+        uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
+        uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox")));
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength());
+    }
+    else
+    {
+        // ComboBox was imported as DropDown text field
+        uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+        uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+        CPPUNIT_ASSERT(xFields->hasMoreElements());
+        uno::Any aField = xFields->nextElement();
+        uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
+        CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+
+        uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items");
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aItems.getLength());
+    }
 }
 
 DECLARE_OOXMLEXPORT_TEST(tdf118169, "tdf118169.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index f9c5997a42b1..f75afc5d322e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -775,15 +775,39 @@ DECLARE_OOXMLEXPORT_TEST(testComboBoxControl, "combobox-control.docx")
     assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dropDownList/w:listItem[2]", "value", "pepito");
     assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:t", "Manolo");
 
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+
     // check imported control
-    uno::Reference<drawing::XControlShape> xControl(getShape(1), uno::UNO_QUERY);
+    if (xDrawPage->getCount() > 0)
+    {
+        uno::Reference<drawing::XControlShape> xControl(getShape(1), uno::UNO_QUERY);
 
-    CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), getProperty<OUString>(xControl->getControl(), "Text"));
+        CPPUNIT_ASSERT_EQUAL(OUString("Manolo"), getProperty<OUString>(xControl->getControl(), "Text"));
 
-    uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(xControl->getControl(), "StringItemList");
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
-    CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
-    CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+        uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(xControl->getControl(), "StringItemList");
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+        CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
+        CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+    }
+    else
+    {
+        // ComboBox was imported as DropDown text field
+        uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+        uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+        CPPUNIT_ASSERT(xFields->hasMoreElements());
+        uno::Any aField = xFields->nextElement();
+        uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
+        CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+
+        CPPUNIT_ASSERT_EQUAL(OUString("manolo"), getProperty<OUString>(aField, "SelectedItem"));
+
+        uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items");
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+        CPPUNIT_ASSERT_EQUAL(OUString("manolo"), aItems[0]);
+        CPPUNIT_ASSERT_EQUAL(OUString("pepito"), aItems[1]);
+    }
 }
 
 DECLARE_OOXMLEXPORT_TEST(testCheckBoxControl, "checkbox-control.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 88f8610cc0e5..0e1416b7ee00 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -933,14 +933,36 @@ DECLARE_OOXMLEXPORT_TEST(testN592908_Picture, "n592908-picture.docx")
 
 DECLARE_OOXMLEXPORT_TEST(testN779630, "n779630.docx")
 {
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+
     // A combo box is imported
-    uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
-    uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
-    uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
-    CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox")));
-    CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), getProperty<OUString>(xPropertySet, "DefaultText"));
-    CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength());
-    CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "Dropdown"));
+    if (xDrawPage->getCount() > 0)
+    {
+        uno::Reference<drawing::XControlShape> xControlShape(getShape(1), uno::UNO_QUERY);
+        uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
+        uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
+        CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.ComboBox")));
+        CPPUNIT_ASSERT_EQUAL(OUString("dropdown default text"), getProperty<OUString>(xPropertySet, "DefaultText"));
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty< uno::Sequence<OUString> >(xPropertySet, "StringItemList").getLength());
+        CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xPropertySet, "Dropdown"));
+    }
+    else
+    {
+        // ComboBox was imported as DropDown text field
+        uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XEnumerationAccess> xFieldsAccess(xTextFieldsSupplier->getTextFields());
+        uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration());
+        CPPUNIT_ASSERT(xFields->hasMoreElements());
+        uno::Any aField = xFields->nextElement();
+        uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
+        CPPUNIT_ASSERT(xServiceInfo->supportsService("com.sun.star.text.textfield.DropDown"));
+
+        uno::Sequence<OUString> aItems = getProperty< uno::Sequence<OUString> >(aField, "Items");
+        CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aItems.getLength());
+        CPPUNIT_ASSERT_EQUAL(OUString("Yes"), aItems[0]);
+        CPPUNIT_ASSERT_EQUAL(OUString("No"), aItems[1]);
+    }
 }
 
 DECLARE_OOXMLEXPORT_TEST(testIndentation, "indentation.docx")
diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx
index aef7ac1e5fbd..3685e92cf942 100644
--- a/writerfilter/source/dmapper/SdtHelper.cxx
+++ b/writerfilter/source/dmapper/SdtHelper.cxx
@@ -16,9 +16,10 @@
 #include <vcl/outdev.hxx>
 #include <comphelper/sequence.hxx>
 #include <xmloff/odffields.hxx>
-
+#include <com/sun/star/text/XTextField.hpp>
 #include "DomainMapper_Impl.hxx"
 #include "StyleSheetTable.hxx"
+#include <officecfg/Office/Writer.hxx>
 
 namespace writerfilter
 {
@@ -80,19 +81,50 @@ SdtHelper::~SdtHelper() = default;
 void SdtHelper::createDropDownControl()
 {
     assert(m_bInsideDropDownControl);
-    OUString aDefaultText = m_aSdtTexts.makeStringAndClear();
-    uno::Reference<awt::XControlModel> xControlModel(
-        m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.form.component.ComboBox"),
-        uno::UNO_QUERY);
-    uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY);
-    xPropertySet->setPropertyValue("DefaultText", uno::makeAny(aDefaultText));
-    xPropertySet->setPropertyValue("Dropdown", uno::makeAny(true));
-    xPropertySet->setPropertyValue("StringItemList",
-                                   uno::makeAny(comphelper::containerToSequence(m_aDropDownItems)));
-
-    createControlShape(
-        lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), aDefaultText, m_aDropDownItems),
-        xControlModel, uno::Sequence<beans::PropertyValue>());
+
+    const bool bDropDown
+        = officecfg::Office::Writer::Filter::Import::DOCX::ImportComboBoxAsDropDown::get();
+    const OUString aDefaultText = m_aSdtTexts.makeStringAndClear();
+
+    if (bDropDown)
+    {
+        // create field
+        uno::Reference<css::text::XTextField> xControlModel(
+            m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.text.TextField.DropDown"),
+            uno::UNO_QUERY);
+
+        // set properties
+        uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY);
+        xPropertySet->setPropertyValue("SelectedItem", uno::makeAny(aDefaultText));
+        xPropertySet->setPropertyValue(
+            "Items", uno::makeAny(comphelper::containerToSequence(m_aDropDownItems)));
+
+        // add it into document
+        m_rDM_Impl.appendTextContent(xControlModel, uno::Sequence<beans::PropertyValue>());
+
+        m_bHasElements = true;
+    }
+    else
+    {
+        // create control
+        uno::Reference<awt::XControlModel> xControlModel(
+            m_rDM_Impl.GetTextFactory()->createInstance("com.sun.star.form.component.ComboBox"),
+            uno::UNO_QUERY);
+
+        // set properties
+        uno::Reference<beans::XPropertySet> xPropertySet(xControlModel, uno::UNO_QUERY);
+        xPropertySet->setPropertyValue("DefaultText", uno::makeAny(aDefaultText));
+        xPropertySet->setPropertyValue("Dropdown", uno::makeAny(true));
+        xPropertySet->setPropertyValue(
+            "StringItemList", uno::makeAny(comphelper::containerToSequence(m_aDropDownItems)));
+
+        // add it into document
+        createControlShape(
+            lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), aDefaultText, m_aDropDownItems),
+            xControlModel, uno::Sequence<beans::PropertyValue>());
+    }
+
+    // clean up
     m_aDropDownItems.clear();
     m_bInsideDropDownControl = false;
 }
commit 1b0abb886715bebae8243e16a1d92f55e445e47c
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Jun 30 12:24:01 2020 +0200
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:32 2020 +0100

    tdf#134404 sw: another subtlety with start/end of section (at-para flys)
    
    fix this problem by comparing the start/end of the selection instead of
    the anchor position, which always has an index of 0:
    
    1. new document with image anchored to paragraph
    2. insert one letter
    3. press Enter
    4. Backspace -> Image gone
    
    (regression from cc4b5091e739116a7ec83513fa1cd856f0130330)
    
    Change-Id: I1219a9f58ce19ea88d697c90c862fe9005318177
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97511
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 17aeb522f566cf225baa5ce524e747089f76728d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97499
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index c46c93bbcec0..c37cffbaf9f8 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1630,14 +1630,14 @@ bool IsSelectFrameAnchoredAtPara(SwPosition const & rAnchorPos,
                 && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0
                         // but not if the selection is backspace/delete!
                         && IsNotBackspaceHeuristic(rStart, rEnd))
-                    || (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection2(rEnd)))))
+                    || (IsAtStartOfSection2(rStart) && IsAtEndOfSection2(rEnd)))))
         && ((rAnchorPos.nNode < rEnd.nNode)
             || (rAnchorPos.nNode == rEnd.nNode
                 && !(nDelContentType & DelContentType::ExcludeFlyAtStartEnd)
                 // special case: fully deleted node
                 && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len()
                         && IsNotBackspaceHeuristic(rStart, rEnd))
-                    || (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection2(rStart)))));
+                    || (IsAtEndOfSection2(rEnd) && IsAtStartOfSection2(rStart)))));
 }
 
 bool IsFlySelectedByCursor(SwDoc const & rDoc,
commit 947ce5e75b81d0d56262f3fe3256f72cedd8a850
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jun 15 20:33:47 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:32 2020 +0100

    tdf#132822 close open undo group before clearing undo stack
    
    when changing paragraph. previous para undo info needs to be discarded, but
    that cannot be done properly if there is an open undo group. So pass the
    optional undo group guard down to GetNextSentence_Impl which can close it
    before it needs to set the new paragraph.
    
    Change-Id: I595c3598b15b6b1fdace045c3879617ecfea3faa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96398
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx
index 64a1b0270589..8c55ee12a72f 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -344,14 +344,14 @@ void SpellDialog::UpdateBoxes_Impl(bool bCallFromSelectHdl)
         m_xDialog->resize_to_request();
 }
 
-void SpellDialog::SpellContinue_Impl(bool bUseSavedSentence, bool bIgnoreCurrentError )
+void SpellDialog::SpellContinue_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard, bool bUseSavedSentence, bool bIgnoreCurrentError)
 {
     //initially or after the last error of a sentence MarkNextError will fail
     //then GetNextSentence() has to be called followed again by MarkNextError()
     //MarkNextError is not initially called if the UndoEdit mode is active
     bool bNextSentence = false;
     if((!m_xSentenceED->IsUndoEditMode() && m_xSentenceED->MarkNextError( bIgnoreCurrentError, xSpell )) ||
-            ( bNextSentence = GetNextSentence_Impl(bUseSavedSentence, m_xSentenceED->IsUndoEditMode()) && m_xSentenceED->MarkNextError( false, xSpell )))
+            ( bNextSentence = GetNextSentence_Impl(pGuard, bUseSavedSentence, m_xSentenceED->IsUndoEditMode()) && m_xSentenceED->MarkNextError( false, xSpell )))
     {
         SpellErrorDescription aSpellErrorDescription;
         bool bSpellErrorDescription = m_xSentenceED->GetAlternatives(aSpellErrorDescription);
@@ -389,7 +389,7 @@ IMPL_LINK_NOARG( SpellDialog, InitHdl, void*, void)
     m_xDialog->freeze();
     //show or hide AutoCorrect depending on the modules abilities
     m_xAutoCorrPB->set_visible(rParent.HasAutoCorrection());
-    SpellContinue_Impl();
+    SpellContinue_Impl(nullptr);
     m_xSentenceED->ResetUndo();
     m_xUndoPB->set_sensitive(false);
 
@@ -506,6 +506,27 @@ IMPL_LINK_NOARG(SpellDialog, DoubleClickChangeHdl, weld::TreeView&, bool)
     return true;
 }
 
+/* tdf#132822 start an undo group in ctor and close it in the dtor. This can
+   then be passed to SpellContinue_Impl which can delete it in advance of its
+   natural scope to force closing the undo group if SpellContinue_Impl needs to
+   fetch a new paragraph and discard all undo information which can only be
+   done properly if there are no open undo groups */
+class UndoChangeGroupGuard
+{
+private:
+    SentenceEditWindow_Impl& m_rSentenceED;
+public:
+    UndoChangeGroupGuard(SentenceEditWindow_Impl& rSentenceED)
+        : m_rSentenceED(rSentenceED)
+    {
+        m_rSentenceED.UndoActionStart(SPELLUNDO_CHANGE_GROUP);
+    }
+    ~UndoChangeGroupGuard()
+    {
+        m_rSentenceED.UndoActionEnd();
+    }
+};
+
 IMPL_LINK_NOARG(SpellDialog, ChangeHdl, weld::Button&, void)
 {
     if (m_xSentenceED->IsUndoEditMode())
@@ -514,11 +535,10 @@ IMPL_LINK_NOARG(SpellDialog, ChangeHdl, weld::Button&, void)
     }
     else
     {
-        m_xSentenceED->UndoActionStart( SPELLUNDO_CHANGE_GROUP );
+        auto xGuard(std::make_unique<UndoChangeGroupGuard>(*m_xSentenceED));
         OUString aString = getReplacementString();
         m_xSentenceED->ChangeMarkedWord(aString, GetSelectedLang_Impl());
-        SpellContinue_Impl();
-        m_xSentenceED->UndoActionEnd();
+        SpellContinue_Impl(&xGuard);
     }
     if(!m_xChangePB->get_sensitive())
         m_xIgnorePB->grab_focus();
@@ -526,7 +546,7 @@ IMPL_LINK_NOARG(SpellDialog, ChangeHdl, weld::Button&, void)
 
 IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl, weld::Button&, void)
 {
-    m_xSentenceED->UndoActionStart( SPELLUNDO_CHANGE_GROUP );
+    auto xGuard(std::make_unique<UndoChangeGroupGuard>(*m_xSentenceED));
     OUString aString = getReplacementString();
     LanguageType eLang = GetSelectedLang_Impl();
 
@@ -548,13 +568,12 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl, weld::Button&, void)
     }
 
     m_xSentenceED->ChangeMarkedWord(aString, eLang);
-    SpellContinue_Impl();
-    m_xSentenceED->UndoActionEnd();
+    SpellContinue_Impl(&xGuard);
 }
 
 IMPL_LINK( SpellDialog, IgnoreAllHdl, weld::Button&, rButton, void )
 {
-    m_xSentenceED->UndoActionStart( SPELLUNDO_CHANGE_GROUP );
+    auto xGuard(std::make_unique<UndoChangeGroupGuard>(*m_xSentenceED));
     // add word to IgnoreAll list
     Reference< XDictionary > aXDictionary = LinguMgr::GetIgnoreAllList();
     //in case the error has been changed manually it has to be restored
@@ -594,8 +613,7 @@ IMPL_LINK( SpellDialog, IgnoreAllHdl, weld::Button&, rButton, void )
         }
     }
 
-    SpellContinue_Impl();
-    m_xSentenceED->UndoActionEnd();
+    SpellContinue_Impl(&xGuard);
 }
 
 IMPL_LINK_NOARG(SpellDialog, UndoHdl, weld::Button&, void)
@@ -644,7 +662,7 @@ IMPL_LINK( SpellDialog, DialogUndoHdl, SpellUndoAction_Impl&, rAction, void )
         case SPELLUNDO_UNDO_EDIT_MODE :
         {
             //refill the dialog with the currently spelled sentence - throw away all changes
-            SpellContinue_Impl(true);
+            SpellContinue_Impl(nullptr, true);
         }
         break;
         case SPELLUNDO_ADD_IGNORE_RULE:
@@ -661,7 +679,7 @@ void SpellDialog::Impl_Restore(bool bUseSavedSentence)
     m_xSentenceED->SetText(OUString());
     m_xSentenceED->ResetModified();
     //Resolves: fdo#39348 refill the dialog with the currently spelled sentence
-    SpellContinue_Impl(bUseSavedSentence);
+    SpellContinue_Impl(nullptr, bUseSavedSentence);
     m_xIgnorePB->set_label(m_sIgnoreOnceST);
 }
 
@@ -678,7 +696,7 @@ IMPL_LINK_NOARG(SpellDialog, IgnoreHdl, weld::Button&, void)
         m_xSentenceED->RestoreCurrentError();
 
         // the word is being ignored
-        SpellContinue_Impl( false, true );
+        SpellContinue_Impl(nullptr, false, true);
     }
 }
 
@@ -817,7 +835,7 @@ IMPL_LINK(SpellDialog, AddToDictSelectHdl, const OString&, rIdent, void)
 
 void SpellDialog::AddToDictionaryExecute(const OString& rItemId)
 {
-    m_xSentenceED->UndoActionStart( SPELLUNDO_CHANGE_GROUP );
+    auto xGuard(std::make_unique<UndoChangeGroupGuard>(*m_xSentenceED));
 
     //GetErrorText() returns the current error even if the text is already
     //manually changed
@@ -858,8 +876,7 @@ void SpellDialog::AddToDictionaryExecute(const OString& rItemId)
     }
 
     // go on
-    SpellContinue_Impl();
-    m_xSentenceED->UndoActionEnd();
+    SpellContinue_Impl(&xGuard);
 }
 
 IMPL_LINK_NOARG(SpellDialog, ModifyHdl, LinkParamNone*, void)
@@ -958,7 +975,7 @@ void SpellDialog::InvalidateDialog()
     SfxModelessDialogController::Deactivate();
 }
 
-bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck)
+bool SpellDialog::GetNextSentence_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard, bool bUseSavedSentence, bool bRecheck)
 {
     bool bRet = false;
     if(!bUseSavedSentence)
@@ -995,6 +1012,9 @@ bool SpellDialog::GetNextSentence_Impl(bool bUseSavedSentence, bool bRecheck)
             if(!elem.bIsHidden)
                 sText.append(elem.sText);
         }
+        // tdf#132822 fire undo-stack UndoActionEnd to close undo stack because we're about to throw away the paragraph entirely
+        if (pGuard)
+            pGuard->reset();
         m_xSentenceED->SetText(sText.makeStringAndClear());
         sal_Int32 nStartPosition = 0;
         sal_Int32 nEndPosition = 0;
diff --git a/cui/source/inc/SpellDialog.hxx b/cui/source/inc/SpellDialog.hxx
index 61adf31f8afa..0ad462789477 100644
--- a/cui/source/inc/SpellDialog.hxx
+++ b/cui/source/inc/SpellDialog.hxx
@@ -33,6 +33,7 @@
 #include <set>
 
 namespace svx{ class SpellUndoAction_Impl;}
+class UndoChangeGroupGuard;
 
 // forward ---------------------------------------------------------------
 
@@ -192,7 +193,7 @@ private:
     int             InitUserDicts();
     void            UpdateBoxes_Impl(bool bCallFromSelectHdl = false);
     void            Init_Impl();
-    void            SpellContinue_Impl(bool UseSavedSentence = false, bool bIgnoreCurrentError = false );
+    void            SpellContinue_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard = nullptr, bool UseSavedSentence = false, bool bIgnoreCurrentError = false );
     void            LockFocusChanges( bool bLock ) {bFocusLocked = bLock;}
     void            ToplevelFocusChanged();
     void            Impl_Restore(bool bUseSavedSentence);
@@ -201,7 +202,7 @@ private:
 
     /** Retrieves the next sentence.
      */
-    bool            GetNextSentence_Impl(bool bUseSavedSentence, bool bRechek /*for rechecking the current sentence*/);
+    bool            GetNextSentence_Impl(std::unique_ptr<UndoChangeGroupGuard>* pGuard, bool bUseSavedSentence, bool bRecheck /*for rechecking the current sentence*/);
     /** Corrects all errors that have been selected to be changed always
      */
     static bool     ApplyChangeAllList_Impl(SpellPortions& rSentence, bool& bHasReplaced);
commit 0b15630ecc6719c03f6ec019fe4b506efd7f40fc
Author:     Vasily Melenchuk <vasily.melenchuk at cib.de>
AuthorDate: Tue Jun 23 08:45:54 2020 +0300
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Sat Jul 4 09:12:32 2020 +0100

    tdf#83309: sw: do not create bullet with no char
    
    On some machines (depending on fonts installed) creation
    of SwBulletPortion with bullet = \0 leads to drawing
    a bullet as a empty rectangle.
    
    Change-Id: I2826944f2278e8c9a6c740b11b69d2e4e5108158
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96711
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 5ed96c798679a1613b058a11b30cce4ba0ffd920)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96886
    Reviewed-by: Vasily Melenchuk <vasily.melenchuk at cib.de>
    (cherry picked from commit 0453702ea9cf48fc5764bb7d2d6685e0234e09cb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97494
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 1930bfa99b30..42d852a1e41e 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -654,11 +654,14 @@ SwNumberPortion *SwTextFormatter::NewNumberPortion( SwTextFormatInfo &rInf ) con
                 lcl_setRedlineAttr( rInf, *pTextNd, pNumFnt );
 
                 // --> OD 2008-01-23 #newlistelevelattrs#
-                pRet = new SwBulletPortion( rNumFormat.GetBulletChar(),
-                                            pTextNd->GetLabelFollowedBy(),
-                                            std::move(pNumFnt),
-                                            bLeft, bCenter, nMinDist,
-                                            bLabelAlignmentPosAndSpaceModeActive );
+                if (rNumFormat.GetBulletChar())
+                {
+                    pRet = new SwBulletPortion(rNumFormat.GetBulletChar(),
+                        pTextNd->GetLabelFollowedBy(),
+                        std::move(pNumFnt),
+                        bLeft, bCenter, nMinDist,
+                        bLabelAlignmentPosAndSpaceModeActive);
+                }
             }
             else
             {


More information about the Libreoffice-commits mailing list