cui/source/customize/SvxNotebookbarConfigPage.cxx | 7 +- sw/qa/extras/ooxmlexport/data/tdf120394.docx |binary sw/qa/extras/ooxmlexport/data/tdf132754.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 41 +++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 5 - sw/source/core/doc/DocumentContentOperationsManager.cxx | 6 +- sw/source/core/doc/docbm.cxx | 7 ++ sw/source/core/doc/docedt.cxx | 2 sw/source/core/doc/number.cxx | 7 ++ sw/source/core/inc/mvsave.hxx | 2 sw/source/core/inc/rolbck.hxx | 2 sw/source/core/undo/rolbck.cxx | 8 ++ sw/source/core/undo/undobj.cxx | 17 +++++ sw/source/filter/ww8/wrtw8num.cxx | 30 +++++----- toolkit/qa/cppunit/EventContainer.cxx | 2 writerfilter/source/dmapper/NumberingManager.cxx | 48 +++------------- 16 files changed, 115 insertions(+), 69 deletions(-)
New commits: commit d5fd91f8e5b9c25a620537c3acc3340231e463ed Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Wed Jun 10 18:51:37 2020 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:32:52 2020 +0100 tdf#132254 sw: fix block selection copy reversed order The problem is that SwEditShell::CopySelToDoc() relies on the passed target SwPosition being after the target range by CopyRange(), but due to an erroneous update of aInsPos in CopyImplImpl() it was at the beginning of the target range. (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5) Change-Id: Ie0846bd44f9349517878efcca996440bede05611 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96063 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit 63a43218c369a43624e6bdbe880b7caa40a3b61a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96092 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 8ba8a4c5a136..403089bdc586 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -4833,10 +4833,10 @@ bool DocumentContentOperationsManager::CopyImplImpl(SwPaM& rPam, SwPosition& rPo } // copy at-char flys in rPam - aInsPos = *pDestTextNd; // update to new (start) node for flys + SwNodeIndex temp(*pDestTextNd); // update to new (start) node for flys // tdf#126626 prevent duplicate Undos ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); - CopyFlyInFlyImpl(aRg, &rPam, aInsPos, false); + CopyFlyInFlyImpl(aRg, &rPam, temp, false); break; } commit 471e033a2dabda43933034be86475387d3c82aea Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Wed Jun 10 17:21:45 2020 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:32:46 2020 +0100 crashtesting: sw: fix export of ooo24576-1.doc and ooo79410-1.sxw to odt Crashes because an at-char fly has its anchor node deleted, and during deletion of its text frame its SwAnchoredObject is updated, which asserts because of inconsistent anchor node in the fly and mpAnchorFrame; the immediate cause of the inconsistency is that SwNodes::RemoveNode() changed the fly's anchor node. The root cause is that in the sw_JoinText(bJoinPrev=true) code, a fly anchored at the end of the deleted node isn't moved to the surviving node. SwTextNode::JoinPrev() uses different arguments to ContentIdxStore::Save(), so use the same here. The implementation of several ContentIdxStore functions, including ContentIdxStoreImpl::SaveFlys(), ignore positions that are equal to the passed nContent index, so passing in SwTextNode::Len() looks wrong. (crash is regression from 98d1622b3721fe899c4e1faa0b4cc35695253014) Change-Id: I3a4d54258611da6b15223273a187c39770caa8e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93583 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit b2b234269b13d5dfd8e7123a25d282d88fee33a0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96104 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index f6e38600f1ba..a695cca98713 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -410,7 +410,7 @@ bool sw_JoinText( SwPaM& rPam, bool bJoinPrev ) pOldTextNd->FormatToTextAttr( pTextNd ); const std::shared_ptr< sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); - pContentStore->Save( pDoc, aOldIdx.GetIndex(), pOldTextNd->Len() ); + pContentStore->Save(pDoc, aOldIdx.GetIndex(), SAL_MAX_INT32); SwIndex aAlphaIdx(pTextNd); pOldTextNd->CutText( pTextNd, aAlphaIdx, SwIndex(pOldTextNd), commit faf8549510aa3d17a14b85108087e6f3f7201ade Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Sun May 17 13:35:46 2020 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:32:39 2020 +0100 tdf#120394: DOCX list import: simplify zero width space hack Since introducion of list format string hack with creation of zero-width-space can be much more simple. It was being used to indicate existing, but empty list label suffix to avoid stripping down numbering. Change-Id: I9a0c6047f806b2c656ef5dbab0c6b38200818bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94383 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95346 diff --git a/sw/qa/extras/ooxmlexport/data/tdf120394.docx b/sw/qa/extras/ooxmlexport/data/tdf120394.docx new file mode 100644 index 000000000000..39bd5886c0fe Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf120394.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 46b4741d7436..17ce04efd87b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -638,6 +638,31 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129353, "tdf129353.docx") aIndexString); } +DECLARE_OOXMLEXPORT_TEST(testTdf120394, "tdf120394.docx") +{ + CPPUNIT_ASSERT_EQUAL(1, getPages()); + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(0), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1"), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(1), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString(CHAR_ZWSP), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(5), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int16>(2), getProperty<sal_Int16>(xPara, "NumberingLevel")); + CPPUNIT_ASSERT_EQUAL(OUString("1.2.1"), getProperty<OUString>(xPara, "ListLabelString")); + } +} + DECLARE_OOXMLEXPORT_TEST(testHyphenationAuto, "hyphenation.odt") { // Explicitly set hyphenation=auto on document level diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 3fe90033be59..d2c2d4d24c8f 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -341,8 +341,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo49692) if (rProp.Name == "Suffix") { - OUString aExpected(u'\x200B'); - CPPUNIT_ASSERT_EQUAL(aExpected, rProp.Value.get<OUString>()); + CPPUNIT_ASSERT(rProp.Value.get<OUString>().isEmpty()); } } } @@ -1367,7 +1366,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf78506) if (rProp.Name == "Suffix") // This was '0', invalid \levelnumbers wasn't ignored. - CPPUNIT_ASSERT_EQUAL(CHAR_ZWSP, rProp.Value.get<OUString>().toChar()); + CPPUNIT_ASSERT(rProp.Value.get<OUString>().isEmpty()); } } diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 481ebfada8eb..c636273e6f54 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -664,6 +664,13 @@ OUString SwNumRule::MakeNumString( const SwNumberTree::tNumberVector & rNumVecto if (nPosition >= 0) sLevelFormat = sLevelFormat.replaceAt(nPosition, sFind.getLength(), sReplacement); } + + // As a fallback: caller code expects nonempty string as a result. + // But if we have empty string (and had no errors before) this is valid result. + // So use classical hack with zero-width-space as a string filling. + if (sLevelFormat.isEmpty()) + sLevelFormat = OUStringChar(CHAR_ZWSP); + aStr = sLevelFormat; } else diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index bde15c7ea279..ec6df09838b5 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -503,12 +503,7 @@ void MSWordExportBase::NumberingLevel( const vcl::Font* pBulletFont=nullptr; rtl_TextEncoding eChrSet=0; FontFamily eFamily=FAMILY_DECORATIVE; - if (rRule.Get(nLvl).HasListFormat()) - { - // Nothing to construct: we have it already - sNumStr = rRule.Get(nLvl).GetListFormat(); - } - else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() || + if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() || SVX_NUM_BITMAP == rFormat.GetNumberingType()) { // Use bullet @@ -516,7 +511,9 @@ void MSWordExportBase::NumberingLevel( } else { - // Construct list format string from prefix, level numbers and suffix + // Create level string + // For docx it is not the best way: we can just take it from rRule.Get(nLvl).GetListFormat() + // But for compatibility with doc we follow same routine if (SVX_NUM_NUMBER_NONE != rFormat.GetNumberingType()) { sal_uInt8* pLvlPos = aNumLvlPos; @@ -527,20 +524,23 @@ void MSWordExportBase::NumberingLevel( // now search the nums in the string for (sal_uInt8 i = 0; i <= nLvl; ++i) { - OUString sSrch( OUString::number( i )); - sal_Int32 nFnd = sNumStr.indexOf( sSrch ); - if( -1 != nFnd ) + OUString sSrch(OUString::number(i)); + sal_Int32 nFnd = sNumStr.indexOf(sSrch); + if (-1 != nFnd) { - *pLvlPos = static_cast<sal_uInt8>(nFnd + rFormat.GetPrefix().getLength() + 1 ); + *pLvlPos = static_cast<sal_uInt8>(nFnd + rFormat.GetPrefix().getLength() + 1); ++pLvlPos; - sNumStr = sNumStr.replaceAt( nFnd, 1, OUString(static_cast<char>(i)) ); + sNumStr = sNumStr.replaceAt(nFnd, 1, OUString(static_cast<char>(i))); } } } - if (!rFormat.GetPrefix().isEmpty()) - sNumStr = rFormat.GetPrefix() + sNumStr; - sNumStr += rFormat.GetSuffix(); + if (!rRule.Get(nLvl).HasListFormat()) + { + if (!rFormat.GetPrefix().isEmpty()) + sNumStr = rFormat.GetPrefix() + sNumStr; + sNumStr += rFormat.GetSuffix(); + } } if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType() || diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index e29639cec28b..30846dc3c290 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -207,10 +207,6 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults { if (m_xGraphicBitmap.is()) nNumberFormat = style::NumberingType::BITMAP; - else if (m_sBulletChar.isEmpty() && nNumberFormat != style::NumberingType::CHAR_SPECIAL) - // w:lvlText is empty, that means no numbering in Word. - // CHAR_SPECIAL is handled separately below. - nNumberFormat = style::NumberingType::NUMBER_NONE; aNumberingProperties.push_back(lcl_makePropVal(PROP_NUMBERING_TYPE, nNumberFormat)); } @@ -548,40 +544,14 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper, if (pLevel.get() && !pLevel->GetBulletChar().isEmpty()) sText = pLevel->GetBulletChar( ); - if (sText.isEmpty()) - { - // Empty <w:lvlText>? Then put a Unicode "zero width space" as a suffix, so LabelFollowedBy is still shown, as in Word. - // With empty suffix, Writer does not show LabelFollowedBy, either. - OUString sSuffix; - auto it = std::find_if(aLvlProps.begin(), aLvlProps.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "NumberingType"; }); - if (it != aLvlProps.end()) - { - sal_Int16 nNumberFormat = it->Value.get<sal_Int16>(); - - // No need for a zero width space without a real LabelFollowedBy. - bool bLabelFollowedBy = true; - it = std::find_if(aLvlProps.begin(), aLvlProps.end(), [](const beans::PropertyValue& rValue) { return rValue.Name == "LabelFollowedBy"; }); - if (it != aLvlProps.end()) - { - sal_Int16 nValue; - if (it->Value >>= nValue) - bLabelFollowedBy = nValue != SvxNumberFormat::NOTHING; - } + aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_PREFIX), OUString(""))); + aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SUFFIX), OUString(""))); + aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_LIST_FORMAT), sText)); - if (bLabelFollowedBy && nNumberFormat == style::NumberingType::NUMBER_NONE) - sSuffix = OUString(u'\x200B'); - } - aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SUFFIX), sSuffix)); - } - else - { - aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_LIST_FORMAT), sText)); - - // Total count of replacement holders is determining amount of required parent numbering to include - // TODO: not sure how "%" symbol is escaped. This is not supported yet - sal_Int16 nParentNum = comphelper::string::getTokenCount(sText, '%'); - aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_PARENT_NUMBERING), nParentNum)); - } + // Total count of replacement holders is determining amount of required parent numbering to include + // TODO: not sure how "%" symbol is escaped. This is not supported yet + sal_Int16 nParentNum = comphelper::string::getTokenCount(sText, '%'); + aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_PARENT_NUMBERING), nParentNum)); aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_POSITION_AND_SPACE_MODE), sal_Int16(text::PositionAndSpaceMode::LABEL_ALIGNMENT))); commit 2a483742ced96bc2bcd64156d87f2cfc71a64341 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Thu Jun 11 15:26:27 2020 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:32:34 2020 +0100 tdf#132744 sw: fix subtle difference when checking end of section In a few places, such as CopyFlyInFlyImpl() and DelFlyInRange(), the passed start/end positions aren't necessarily from a cursor but can be section start/end nodes instead. (regression from 971205dc2110c1c23ff1db1fc4041e2babf6fa9f) Change-Id: I1fb24f1f9d027aa3685ac5a7459891cb8c2b9a41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96124 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit cc4b5091e739116a7ec83513fa1cd856f0130330) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96147 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index e6a6d5a509d7..eb42e7dfbc0c 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -1532,6 +1532,19 @@ static bool IsAtStartOfSection(SwPosition const& rAnchorPos) return node == rAnchorPos.nNode && rAnchorPos.nContent == 0; } +/// passed start / end position could be on section start / end node +static bool IsAtEndOfSection2(SwPosition const& rPos) +{ + return rPos.nNode.GetNode().IsEndNode() + || IsAtEndOfSection(rPos); +} + +static bool IsAtStartOfSection2(SwPosition const& rPos) +{ + return rPos.nNode.GetNode().IsStartNode() + || IsAtStartOfSection(rPos); +} + static bool IsNotBackspaceHeuristic( SwPosition const& rStart, SwPosition const& rEnd) { @@ -1573,13 +1586,13 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, && ((rStart.nNode != rEnd.nNode && rStart.nContent == 0 // but not if the selection is backspace/delete! && IsNotBackspaceHeuristic(rStart, rEnd)) - || (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection(rEnd))))) + || (IsAtStartOfSection(rAnchorPos) && IsAtEndOfSection2(rEnd))))) && ((rAnchorPos < rEnd) || (rAnchorPos == rEnd // special case: fully deleted node && ((rEnd.nNode != rStart.nNode && rEnd.nContent == rEnd.nNode.GetNode().GetTextNode()->Len() && IsNotBackspaceHeuristic(rStart, rEnd)) - || (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection(rStart))))); + || (IsAtEndOfSection(rAnchorPos) && IsAtStartOfSection2(rStart))))); } bool IsSelectFrameAnchoredAtPara(SwPosition const & rAnchorPos, commit 9b388da45565e2a1a522a4ec8fbca3fde53ca00e Author: Serge Krot <serge.k...@cib.de> AuthorDate: Wed Jun 10 19:15:41 2020 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:32:26 2020 +0100 tdf#101856 copy missing bookmark properties - in case of undo/redo - in case of copying bookmark Change-Id: Ia21f42973b0e7c2cc4abfe2febe9818509aec4d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96038 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 49920f65d503..8ba8a4c5a136 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -297,6 +297,8 @@ namespace sw { pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode()); pNewBookmark->SetShortName(pOldBookmark->GetShortName()); + pNewBookmark->Hide(pOldBookmark->IsHidden()); + pNewBookmark->SetHideCondition(pOldBookmark->GetHideCondition()); } ::sw::mark::IFieldmark* const pNewFieldmark = dynamic_cast< ::sw::mark::IFieldmark* const >(pNewMark); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 5e5063b72f92..17db4aed5f4e 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1630,7 +1630,7 @@ SaveBookmark::SaveBookmark( const SwNodeIndex & rMvPos, const SwIndex* pIdx) : m_aName(rBkmk.GetName()) - , m_aShortName() + , m_bHidden(false) , m_aCode() , m_eOrigBkmType(IDocumentMarkAccess::GetType(rBkmk)) { @@ -1639,6 +1639,8 @@ SaveBookmark::SaveBookmark( { m_aShortName = pBookmark->GetShortName(); m_aCode = pBookmark->GetKeyCode(); + m_bHidden = pBookmark->IsHidden(); + m_aHideCondition = pBookmark->GetHideCondition(); ::sfx2::Metadatable const*const pMetadatable( dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)); @@ -1707,6 +1709,9 @@ void SaveBookmark::SetInDoc( { pBookmark->SetKeyCode(m_aCode); pBookmark->SetShortName(m_aShortName); + pBookmark->Hide(m_bHidden); + pBookmark->SetHideCondition(m_aHideCondition); + if (m_pMetadataUndo) { ::sfx2::Metadatable * const pMeta( diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index bdbab23f08ab..c472b6f7bc1a 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -58,6 +58,8 @@ namespace sw { namespace mark private: OUString const m_aName; OUString m_aShortName; + bool m_bHidden; + OUString m_aHideCondition; vcl::KeyCode m_aCode; IDocumentMarkAccess::MarkType const m_eOrigBkmType; sal_uLong m_nNode1; diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx index 2abe1d590b88..7cceb86a58e6 100644 --- a/sw/source/core/inc/rolbck.hxx +++ b/sw/source/core/inc/rolbck.hxx @@ -249,6 +249,8 @@ class SwHistoryBookmark : public SwHistoryHint private: const OUString m_aName; OUString m_aShortName; + bool m_bHidden; + OUString m_aHideCondition; vcl::KeyCode m_aKeycode; const sal_uLong m_nNode; const sal_uLong m_nOtherNode; diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index ef4815a1cff4..50ff24aa4d98 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -559,8 +559,7 @@ SwHistoryBookmark::SwHistoryBookmark( bool bSaveOtherPos) : SwHistoryHint(HSTRY_BOOKMARK) , m_aName(rBkmk.GetName()) - , m_aShortName() - , m_aKeycode() + , m_bHidden(false) , m_nNode(bSavePos ? rBkmk.GetMarkPos().nNode.GetIndex() : 0) , m_nOtherNode(bSaveOtherPos ? @@ -579,6 +578,8 @@ SwHistoryBookmark::SwHistoryBookmark( { m_aKeycode = pBookmark->GetKeyCode(); m_aShortName = pBookmark->GetShortName(); + m_bHidden = pBookmark->IsHidden(); + m_aHideCondition = pBookmark->GetHideCondition(); ::sfx2::Metadatable const*const pMetadatable( dynamic_cast< ::sfx2::Metadatable const* >(pBookmark)); @@ -653,6 +654,9 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) { pBookmark->SetKeyCode(m_aKeycode); pBookmark->SetShortName(m_aShortName); + pBookmark->Hide(m_bHidden); + pBookmark->SetHideCondition(m_aHideCondition); + if (m_pMetadataUndo) { ::sfx2::Metadatable * const pMeta( commit 5e1b1db3ce535debfa4a489d1d02ba14b31094a0 Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Sun May 10 00:43:59 2020 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:29:28 2020 +0100 tdf#132754: DOCX import: changed default list start nubmer Default value for list numbering startAt is zero. If it is not proveded numbering starts from this value. Change-Id: I2cf7be9063e7bfb8b72d6ba77fcd9507e33bb848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93899 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> (cherry picked from commit f8211e84a5239de25fe6dc45a4bb6b6f8673a1ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96048 diff --git a/sw/qa/extras/ooxmlexport/data/tdf132754.docx b/sw/qa/extras/ooxmlexport/data/tdf132754.docx new file mode 100644 index 000000000000..baec54f5e0d7 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf132754.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 5a99b366caa0..46b4741d7436 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -595,6 +595,22 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf128889, "tdf128889.fodt") assertXPath(pXml, "/w:document/w:body/w:p[1]/w:r[2]/w:br", "type", "page"); } +DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf132754, "tdf132754.docx") +{ + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.0."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(2), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.1."), getProperty<OUString>(xPara, "ListLabelString")); + } + { + uno::Reference<beans::XPropertySet> xPara(getParagraph(3), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("0.0.2."), getProperty<OUString>(xPara, "ListLabelString")); + } +} + DECLARE_OOXMLEXPORT_TEST(testTdf129353, "tdf129353.docx") { CPPUNIT_ASSERT_EQUAL(8, getParagraphs()); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index be74368bfcf7..e29639cec28b 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -189,8 +189,10 @@ uno::Sequence<beans::PropertyValue> ListLevel::GetLevelProperties(bool bDefaults { std::vector<beans::PropertyValue> aNumberingProperties; - if( m_nIStartAt >= 0) + if (m_nIStartAt >= 0) aNumberingProperties.push_back(lcl_makePropVal<sal_Int16>(PROP_START_WITH, m_nIStartAt) ); + else if (bDefaults) + aNumberingProperties.push_back(lcl_makePropVal<sal_Int16>(PROP_START_WITH, 0)); sal_Int16 nNumberFormat = -1; if (m_nNFC == NS_ooxml::LN_Value_ST_NumberFormat_custom) commit 6838dd995587b47875c7d43ab9c3e4516170f8e6 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jun 10 15:53:56 2020 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:29:13 2020 +0100 Resolves: tdf#133862 crash in customize toolbar in embedded math Change-Id: I2fc7f3620145e48516c3ca73c0a5d08dce11d78a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96035 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx index c8270b941385..198a19f57782 100644 --- a/cui/source/customize/SvxNotebookbarConfigPage.cxx +++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx @@ -433,6 +433,8 @@ void SvxNotebookbarConfigPage::SelectElement() OString sUIFileUIPath = CustomNotebookbarGenerator::getSystemPath( CustomNotebookbarGenerator::getCustomizedUIPath()); xmlDocPtr pDoc = xmlParseFile(sUIFileUIPath.getStr()); + if (!pDoc) + return; xmlNodePtr pNodePtr = xmlDocGetRootElement(pDoc); std::vector<NotebookbarEntries> aEntries; @@ -494,10 +496,7 @@ void SvxNotebookbarConfigPage::SelectElement() aEntries.clear(); - if (pDoc != nullptr) - { - xmlFreeDoc(pDoc); - } + xmlFreeDoc(pDoc); } SvxNotebookbarEntriesListBox::SvxNotebookbarEntriesListBox(std::unique_ptr<weld::TreeView> xParent, commit a856c45f59dee01a4d21b7ccc97606d474581e7c Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Mon May 11 07:48:23 2020 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Fri Jun 12 16:29:09 2020 +0100 Fix 32bit linux build Change-Id: I4faf3fb20c632163f98264d162bbf85f80b3603d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93797 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> (cherry picked from commit fa0d576378cafab396a3fb75b1dbe1905d5df9ce) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96090 Reviewed-by: Michael Stahl <michael.st...@cib.de> diff --git a/toolkit/qa/cppunit/EventContainer.cxx b/toolkit/qa/cppunit/EventContainer.cxx index 300c8e5adb74..97a125c60824 100644 --- a/toolkit/qa/cppunit/EventContainer.cxx +++ b/toolkit/qa/cppunit/EventContainer.cxx @@ -70,7 +70,7 @@ CPPUNIT_TEST_FIXTURE(EventContainerTest, testInsertOrder) Sequence<OUString> aEventNames(xEvents->getElementNames()); sal_Int32 nEventCount = aEventNames.getLength(); - CPPUNIT_ASSERT_EQUAL(4, nEventCount); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4), nEventCount); CPPUNIT_ASSERT_EQUAL(OUString("b"), aEventNames[0]); CPPUNIT_ASSERT_EQUAL(OUString("a"), aEventNames[1]); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits