[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/uiwriter/data/tdf89954.odt|binary sw/qa/extras/uiwriter/uiwriter.cxx | 22 + sw/source/core/txtnode/thints.cxx |2 - writerfilter/source/dmapper/GraphicImport.hxx |4 +-- writerfilter/source/dmapper/StyleSheetTable.cxx|1 writerfilter/source/dmapper/StyleSheetTable.hxx|5 ++-- writerfilter/source/dmapper/TextEffectsHandler.hxx |4 +-- 7 files changed, 30 insertions(+), 8 deletions(-) New commits: commit e1953f22097d6f895fe27ea21635c37d3cb48f51 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jul 29 09:15:59 2015 +0200 writerfilter: clean up remaining boost::scoped_ptr usage Change-Id: I270c91bec75ff96ac77b550e6adef8d03b07f2b5 diff --git a/writerfilter/source/dmapper/GraphicImport.hxx b/writerfilter/source/dmapper/GraphicImport.hxx index 6a10ddb..736a580 100644 --- a/writerfilter/source/dmapper/GraphicImport.hxx +++ b/writerfilter/source/dmapper/GraphicImport.hxx @@ -20,7 +20,7 @@ #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_GRAPHICIMPORT_HXX #include queue -#include boost/scoped_ptr.hpp +#include memory #include LoggedResources.hxx @@ -64,7 +64,7 @@ enum GraphicImportType class GraphicImport : public LoggedProperties, public LoggedTable ,public BinaryObj, public LoggedStream { -boost::scoped_ptrGraphicImport_Impl m_pImpl; +std::unique_ptrGraphicImport_Impl m_pImpl; css::uno::Referencecss::uno::XComponentContext m_xComponentContext; css::uno::Referencecss::lang::XMultiServiceFactory m_xTextFactory; diff --git a/writerfilter/source/dmapper/TextEffectsHandler.hxx b/writerfilter/source/dmapper/TextEffectsHandler.hxx index 02bd9a9..cce0872 100644 --- a/writerfilter/source/dmapper/TextEffectsHandler.hxx +++ b/writerfilter/source/dmapper/TextEffectsHandler.hxx @@ -21,7 +21,7 @@ #include oox/helper/grabbagstack.hxx -#include boost/scoped_ptr.hpp +#include memory #include boost/optional.hpp namespace writerfilter { @@ -34,7 +34,7 @@ class TextEffectsHandler : public LoggedProperties private: boost::optionalPropertyIds maPropertyId; OUString maElementName; -boost::scoped_ptroox::GrabBagStack mpGrabBagStack; +std::unique_ptroox::GrabBagStack mpGrabBagStack; void convertElementIdToPropertyId(sal_Int32 aElementId); commit 7b1c5b297746e1fbc7d8b728e888478a260c52e4 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jul 29 09:10:44 2015 +0200 writerfilter: use std::unique_ptr in StyleSheetTable Change-Id: I38eebe098c87cceb69b9ff4c48e18d3434ad1557 diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 826172b..cdc0e59 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -390,7 +390,6 @@ StyleSheetTable::StyleSheetTable(DomainMapper rDMapper, StyleSheetTable::~StyleSheetTable() { -delete m_pImpl; } PropertyMapPtr StyleSheetTable::GetDefaultCharProps() diff --git a/writerfilter/source/dmapper/StyleSheetTable.hxx b/writerfilter/source/dmapper/StyleSheetTable.hxx index 44d33ea..ba05630 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.hxx +++ b/writerfilter/source/dmapper/StyleSheetTable.hxx @@ -19,6 +19,7 @@ #ifndef INCLUDED_WRITERFILTER_SOURCE_DMAPPER_STYLESHEETTABLE_HXX #define INCLUDED_WRITERFILTER_SOURCE_DMAPPER_STYLESHEETTABLE_HXX +#include memory #include TblStylePrHandler.hxx #include DomainMapper.hxx @@ -77,7 +78,7 @@ public: }; typedef std::shared_ptrStyleSheetEntry StyleSheetEntryPtr; -typedef ::std::dequeStyleSheetEntryPtr StyleSheetEntryDeque; +typedef std::dequeStyleSheetEntryPtr StyleSheetEntryDeque; typedef std::shared_ptrStyleSheetEntryDeque StyleSheetEntryDequePtr; class DomainMapper; @@ -85,7 +86,7 @@ class StyleSheetTable : public LoggedProperties, public LoggedTable { -StyleSheetTable_Impl *m_pImpl; +std::unique_ptrStyleSheetTable_Impl m_pImpl; public: StyleSheetTable(DomainMapper rDMapper, css::uno::Referencecss::text::XTextDocument const xTextDocument, bool bIsNewDoc); commit 89d615360e80a13fff6bc69885e5780d8fedf149 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jul 29 09:08:00 2015 +0200 tdf#89954 sw: let annotation have CH_TXTATR_INWORD placeholder again Regression from commit 0761f81643a6890457e9ef7d913ab5c88c2593a4 (123792: complete annotations on text ranges feature, 2013-12-19), the problem was that while sw wanted CH_TXTATR_INWORD as a placeholder character for anchor positions that do not count as a word boundary, the commit changed GetCharOfTextAttr() so that annotations have CH_TXTATR_BREAKWORD as the placeholder. Fix the problem by reverting the last hunk of sw/source/core/txtnode/thints.cxx changes in that commit. Change-Id:
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
dev/null |binary sw/qa/extras/uiwriter/data/tdf90003.odt |binary sw/qa/extras/uiwriter/uiwriter.cxx| 23 +-- sw/source/core/text/itrform2.cxx |7 sw/source/uibase/inc/wrtsh.hxx| 110 +++--- sw/source/uibase/wrtsh/move.cxx | 108 +++--- sw/source/uibase/wrtsh/select.cxx | 196 +- sw/source/uibase/wrtsh/wrtsh1.cxx | 58 +++ sw/source/uibase/wrtsh/wrtsh2.cxx |8 - sw/source/uibase/wrtsh/wrtsh3.cxx | 18 +- sw/source/uibase/wrtsh/wrtundo.cxx|4 writerfilter/source/dmapper/SettingsTable.cxx | 26 +-- 12 files changed, 275 insertions(+), 283 deletions(-) New commits: commit bcefd5cda926f86db16b1bcf6838431b5b0d61b5 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat Mar 14 15:55:40 2015 +0100 SwWrtShell: rename member variables missing their prefixes Change-Id: I78ae647cca9167e130592fd11b8dd15c512a2353 diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 2e7c4cd..7880165 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -94,19 +94,19 @@ private: typedef long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp ); -SELECTFUNC fnDrag; -SELECTFUNC fnSetCrsr; -SELECTFUNC fnEndDrag; -SELECTFUNC fnKillSel; +SELECTFUNC m_fnDrag; +SELECTFUNC m_fnSetCrsr; +SELECTFUNC m_fnEndDrag; +SELECTFUNC m_fnKillSel; public: using SwEditShell::Insert; -long SetCursor(const Point* pPt, bool bProp) { return (this-*fnSetCrsr)(pPt, bProp); } -long Drag (const Point* pPt, bool bProp) { return (this-*fnDrag)(pPt, bProp); } -long EndDrag (const Point* pPt, bool bProp) { return (this-*fnEndDrag)(pPt, bProp); } -long KillSelection(const Point* pPt, bool bProp) { return (this-*fnKillSel)(pPt, bProp); } +long SetCursor(const Point* pPt, bool bProp) { return (this-*m_fnSetCrsr)(pPt, bProp); } +long Drag (const Point* pPt, bool bProp) { return (this-*m_fnDrag)(pPt, bProp); } +long EndDrag (const Point* pPt, bool bProp) { return (this-*m_fnEndDrag)(pPt, bProp); } +long KillSelection(const Point* pPt, bool bProp) { return (this-*m_fnKillSel)(pPt, bProp); } // reset all selections long ResetSelect( const Point *, bool ); @@ -115,45 +115,45 @@ public: inline void ResetCursorStack(); SelectionType GetSelectionType() const; -boolIsModePushed() const { return 0 != pModeStack; } +boolIsModePushed() const { return 0 != m_pModeStack; } voidPushMode(); voidPopMode(); voidSttSelect(); voidEndSelect(); -boolIsInSelect() const { return bInSelect; } -voidSetInSelect(bool bSel = true) { bInSelect = bSel; } +boolIsInSelect() const { return m_bInSelect; } +voidSetInSelect(bool bSel = true) { m_bInSelect = bSel; } // is there a text- or frameselection? boolHasSelection() const { return SwCrsrShell::HasSelection() || IsMultiSelection() || IsSelFrmMode() || IsObjSelected(); } bool Pop( bool bOldCrsr = true ); voidEnterStdMode(); -boolIsStdMode() const { return !bExtMode !bAddMode !bBlockMode; } +boolIsStdMode() const { return !m_bExtMode !m_bAddMode !m_bBlockMode; } voidEnterExtMode(); voidLeaveExtMode(); boolToggleExtMode(); -boolIsExtMode() const { return bExtMode; } +boolIsExtMode() const { return m_bExtMode; } voidEnterAddMode(); voidLeaveAddMode(); boolToggleAddMode(); -boolIsAddMode() const { return bAddMode; } +boolIsAddMode() const { return m_bAddMode; } voidEnterBlockMode(); voidLeaveBlockMode(); boolToggleBlockMode(); -boolIsBlockMode() const { return bBlockMode; } +boolIsBlockMode() const { return m_bBlockMode; } voidSetInsMode( bool bOn = true ); -voidToggleInsMode() { SetInsMode( !bIns ); } -boolIsInsMode() const { return bIns; } +voidToggleInsMode() { SetInsMode( !m_bIns ); } +boolIsInsMode() const { return m_bIns; } voidSetRedlineModeAndCheckInsMode( sal_uInt16 eMode ); voidEnterSelFrmMode(const Point *pStartDrag = 0); voidLeaveSelFrmMode(); -boolIsSelFrmMode() const { return bLayoutMode; } +boolIsSelFrmMode() const { return m_bLayoutMode; } // reset selection of frames voidUnSelectFrm(); @@ -164,9 +164,9 @@ public: inline void EndSelTblCells(); // leave per word or per line selection mode. Is usually called in MB-Up. -boolIsExtSel() const { return bSelWrd || bSelLn; } +boolIsExtSel() const { return m_bSelWrd || m_bSelLn; } -//
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |5 +++ sw/source/filter/ww8/docxexport.cxx| 13 + writerfilter/source/dmapper/SettingsTable.cxx | 24 + writerfilter/source/ooxml/OOXMLFastDocumentHandler.cxx |6 4 files changed, 42 insertions(+), 6 deletions(-) New commits: commit 5a410df4ff5edd9ea2fbe5469084bb0e8b57bd1c Author: Miklos Vajna vmik...@collabora.co.uk Date: Thu Dec 11 19:18:06 2014 +0100 DOCX export: handle w:autoHyphenation/ Change-Id: Ie4bb2b3bf7d2df58c30a54ded68f7b932c2111ed diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 923a82f..d2a4c7f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -462,6 +462,11 @@ DECLARE_OOXMLEXPORT_TEST(testfdo78599,fdo78599.docx) return; //docx file after RT is getting corrupted. assertXPath ( pXmlDoc, /w:document/w:body/w:p[1]/w:hyperlink/w:r[6]/w:fldChar, fldCharType, end ); + +// Check for automatic hyphenation +if (xmlDocPtr pSettingsXml = parseExport(word/settings.xml)) +// This failed as w:settings had no w:autoHyphenation child. +assertXPath(pSettingsXml, /w:settings/w:autoHyphenation); } DECLARE_OOXMLEXPORT_TEST(testfdo78886, fdo78886.docx) diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index 6cb7d80..48ebe66 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -43,6 +43,7 @@ #include IMark.hxx #include IDocumentSettingAccess.hxx #include IDocumentLayoutAccess.hxx +#include IDocumentStylePoolAccess.hxx #include docsh.hxx #include ndtxt.hxx #include wrtww8.hxx @@ -58,6 +59,7 @@ #include editeng/editobj.hxx #include editeng/outlobj.hxx #include editeng/brushitem.hxx +#include editeng/hyphenzoneitem.hxx #include docary.hxx #include numrule.hxx @@ -849,6 +851,17 @@ void DocxExport::WriteSettings() pFS-singleElementNS( XML_w, XML_defaultTabStop, FSNS( XML_w, XML_val ), OString::number( m_aSettings.defaultTabStop).getStr(), FSEND ); +// Automatic hyphenation: it's a global setting in Word, it's a paragraph setting in Writer. +// Use the setting from the default style. +SwTxtFmtColl* pColl = pDoc-getIDocumentStylePoolAccess().GetTxtCollFromPool(RES_POOLCOLL_STANDARD, /*bRegardLanguage=*/false); +const SfxPoolItem* pItem; +if (pColl SfxItemState::SET == pColl-GetItemState(RES_PARATR_HYPHENZONE, false, pItem)) +{ +pFS-singleElementNS(XML_w, XML_autoHyphenation, + FSNS(XML_w, XML_val), OString::boolean(static_castconst SvxHyphenZoneItem*(pItem)-IsHyphen()), + FSEND); +} + // Even and Odd Headers if( m_aSettings.evenAndOddHeaders ) pFS-singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND ); commit d93d09c5065cf4342402b6f4e1216406d3cf9b24 Author: Miklos Vajna vmik...@collabora.co.uk Date: Thu Dec 11 18:10:28 2014 +0100 DOCX import: handle w:autoHyphenation/ It's the OOXML equivalent of the fAutoHyphen DOP flag from [MS-DOC]. Change-Id: Iae66dcd0d350ce4ebee3c3493ee07eff0d9a5e1d diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index dd2cef5..76dff4c 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -21,6 +21,10 @@ #include rtl/ustring.hxx #include resourcemodel/ResourceModelHelper.hxx #include com/sun/star/beans/XPropertySet.hpp +#include com/sun/star/beans/XPropertyState.hpp +#include com/sun/star/container/XNameContainer.hpp +#include com/sun/star/style/XStyle.hpp +#include com/sun/star/style/XStyleFamiliesSupplier.hpp #include SettingsTable.hxx #include ooxml/resourceids.hxx #include ConversionHelper.hxx @@ -75,6 +79,7 @@ struct SettingsTable_Impl boolembedSystemFonts; boolm_bDoNotUseHTMLParagraphAutoSpacing; boolm_bNoColumnBalance; +boolm_bAutoHyphenation; boolm_bSplitPgBreakAndParaMark; boolm_bMirrorMargin; uno::Sequencebeans::PropertyValue m_pThemeFontLangProps; @@ -106,6 +111,7 @@ struct SettingsTable_Impl , embedSystemFonts(false) , m_bDoNotUseHTMLParagraphAutoSpacing(false) , m_bNoColumnBalance(false) +, m_bAutoHyphenation(false) , m_bSplitPgBreakAndParaMark(false) , m_bMirrorMargin(false) , m_pThemeFontLangProps(3) @@ -281,6 +287,9 @@ void SettingsTable::lcl_sprm(Sprm rSprm) case NS_ooxml::LN_CT_Compat_noColumnBalance: m_pImpl-m_bNoColumnBalance = nIntValue; break; +case NS_ooxml::LN_CT_Settings_autoHyphenation: +m_pImpl-m_bAutoHyphenation = nIntValue; +break; default: { #ifdef
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/rtfexport/data/num-override-start.rtf | 29 +++ sw/qa/extras/rtfexport/rtfexport.cxx |7 + sw/source/filter/ww8/docxtablestyleexport.cxx | 86 ++--- writerfilter/source/dmapper/NumberingManager.cxx | 12 -- writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 5 files changed, 82 insertions(+), 54 deletions(-) New commits: commit 74249cb6f4f52b7c10ebaa92f943920f6f94aaf4 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat Nov 22 12:34:06 2014 +0100 RTF import: fix handling of multiple \lfolevel control words Change-Id: I242853d491c2ef83f192486fa6fe5a3407700047 diff --git a/sw/qa/extras/rtfexport/data/num-override-start.rtf b/sw/qa/extras/rtfexport/data/num-override-start.rtf new file mode 100644 index 000..aa1a2d4 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/num-override-start.rtf @@ -0,0 +1,29 @@ +{\rtf1 +{\*\listtable +{\list\listtemplateid-1627985480 +{\listlevel\levelnfc0 +\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0 +{\leveltext\'02\'00.;} +{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \s15\fi-360\li720\lin720 } +{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0 +\levelstartat1\levellegal\levelspace0\levelindent0 +{\leveltext\'03\'00.\'01;} +{\levelnumbers\'01\'03;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0 \fi-360\li360\lin360 } +{\listname ;} +\listid94861222} +} +{\*\listoverridetable +{\listoverride\listid94861222\listoverridecount2 +{\lfolevel\listoverridestartat\levelstartat1} +{\lfolevel\listoverridestartat\levelstartat3} +\ls1} +} +\pard\plain \ltrpar\s16\ql \fi-360\li360\ri0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls1\ilvl1\adjustright\rin0\lin360\itap0\pararsid16599941 \rtlch\fcs1 \ab\af0\afs24\alang1025 \ltrch\fcs0 +\b\fs28\lang3082\langfe3082\cgrid\langnp3082\langfenp3082 +{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 \fs20\lang2057\langfe3082\langnp2057\insrsid16599941 This should be 1.3} +{\rtlch\fcs1 \af0\afs20 \ltrch\fcs0 +\fs20\lang2057\langfe3082\langnp2057\insrsid14181417\charrsid16599941 +\par } +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 12fbfd1..c4118c6 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -836,6 +836,13 @@ DECLARE_RTFEXPORT_TEST(testTableRtl, table-rtl.rtf) CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getPropertysal_Int16(xTable, WritingMode)); } +DECLARE_RTFEXPORT_TEST(testNumOverrideStart, num-override-start.rtf) +{ +// The numbering on the second level was 3.1, not 1.3. +uno::Referencecontainer::XIndexAccess xRules = getProperty uno::Referencecontainer::XIndexAccess (getStyles(NumberingStyles)-getByName(WWNum1), NumberingRules); +CPPUNIT_ASSERT_EQUAL(sal_Int16(1), comphelper::SequenceAsHashMap(xRules-getByIndex(0))[StartWith].getsal_Int16()); +CPPUNIT_ASSERT_EQUAL(sal_Int16(3), comphelper::SequenceAsHashMap(xRules-getByIndex(1))[StartWith].getsal_Int16()); +} CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 70cc3da..246cb4f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -5901,7 +5901,7 @@ int RTFDocumentImpl::popState() aState.aTableAttributes.set(NS_ooxml::LN_CT_NumLvl_ilvl, pInnerValue); RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes, aState.aTableSprms)); -m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, pValue); +m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Num_lvlOverride, pValue, OVERWRITE_NO_APPEND); } break; // list override table commit f2f171a4dbec9e3adac7ff66c1417ced84cd0d8e Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat Nov 22 12:19:35 2014 +0100 Use comphelper::SequenceAsVector Change-Id: I0d2c312f903a2a326961430caa772a4841f4fa87 diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 2412f8c..0a1c52f 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -263,7 +263,7 @@ uno::Sequence beans::PropertyValue ListLevel::GetLevelProperties( ) }; PropertyNameSupplier aPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier(); -PropertyValueVector_t aNumberingProperties; +comphelper::SequenceAsVectorbeans::PropertyValue aNumberingProperties; if( m_nIStartAt = 0) aNumberingProperties.push_back( MAKE_PROPVAL(PROP_START_WITH, (sal_Int16)m_nIStartAt) ); @@ -343,15 +343,7 @@ uno::Sequence beans::PropertyValue ListLevel::GetLevelProperties( ) beans::PropertyValue( aPropNameSupplier.GetName(PROP_BULLET_FONT_NAME), 0, aPropFont-second,
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/rtfimport/data/fdo82076.rtf | 13 + sw/qa/extras/rtfimport/rtfimport.cxx | 11 +++ sw/source/filter/ww8/docxexport.cxx|2 +- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 19 ++- writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 ++- writerfilter/source/rtftok/rtfsdrimport.cxx| 12 +++- 6 files changed, 52 insertions(+), 8 deletions(-) New commits: commit 8c6d3cd45e2183a19f91e9a30c1fdc699de393f8 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sun Oct 26 14:42:19 2014 +0100 Avoid boost::optionalbool Change-Id: Idaacaf80098e59df47183741402c8664ba5ea631 diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index f15a675..f2081b4 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -42,6 +42,8 @@ #include oox/drawingml/shapepropertymap.hxx #include oox/helper/propertyset.hxx +#include boost/logic/tribool.hpp + using namespace com::sun::star; namespace writerfilter @@ -147,7 +149,7 @@ void RTFSdrImport::applyProperty(uno::Referencedrawing::XShape const xShape, uno::Referencebeans::XPropertySet xPropertySet(xShape, uno::UNO_QUERY); sal_Int16 nHoriOrient = 0; sal_Int16 nVertOrient = 0; -boost::optionalbool obFitShapeToText; +boost::logic::tribool obFitShapeToText(boost::logic::indeterminate); bool bFilled = true; if (aKey == posh) @@ -191,7 +193,7 @@ void RTFSdrImport::applyProperty(uno::Referencedrawing::XShape const xShape, } } else if (aKey == fFitShapeToText) -obFitShapeToText.reset(aValue.toInt32() == 1); +obFitShapeToText = aValue.toInt32() == 1; else if (aKey == fFilled) bFilled = aValue.toInt32() == 1; else if (aKey == rotation) @@ -208,10 +210,10 @@ void RTFSdrImport::applyProperty(uno::Referencedrawing::XShape const xShape, xPropertySet-setPropertyValue(HoriOrient, uno::makeAny(nHoriOrient)); if (nVertOrient != 0 xPropertySet.is()) xPropertySet-setPropertyValue(VertOrient, uno::makeAny(nVertOrient)); -if (obFitShapeToText xPropertySet.is()) +if (!boost::logic::indeterminate(obFitShapeToText) xPropertySet.is()) { -xPropertySet-setPropertyValue(SizeType, uno::makeAny(*obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX)); -xPropertySet-setPropertyValue(FrameIsAutomaticHeight, uno::makeAny(*obFitShapeToText)); +xPropertySet-setPropertyValue(SizeType, uno::makeAny(obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX)); +xPropertySet-setPropertyValue(FrameIsAutomaticHeight, uno::makeAny(static_castbool(obFitShapeToText))); } if (!bFilled xPropertySet.is()) { commit cc926007e2471b9d7396a9724cae026e27e52ed2 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sun Oct 26 14:32:37 2014 +0100 Let's have both switchHeaderFooter() calls in DocxExport::WriteHeaderFooter() Change-Id: I051a2a74e0da44b8f13a21e052c35581159402f1 diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index d15e4d2..67540eb 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -266,7 +266,6 @@ void DocxExport::WriteHeadersFooters( sal_uInt8 nHeadFootFlags, // Turn OFF flag for 'Writing Headers \ Footers' m_pAttrOutput-SetWritingHeaderFooter( false ); -m_pAttrOutput-switchHeaderFooter(false, -1); #if OSL_DEBUG_LEVEL 1 fprintf( stderr, DocxExport::WriteHeadersFooters() - nBreakCode introduced, but ignored\n ); #endif @@ -720,6 +719,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt rFmt, bool bHeader, const char* m_pAttrOutput-switchHeaderFooter(true, m_nHeadersFootersInSection++); // do the work WriteHeaderFooterText( rFmt, bHeader ); +m_pAttrOutput-switchHeaderFooter(false, -1); m_pAttrOutput-EndParaSdtBlock(); //When the stream changes the cache which is maintained for the graphics in case of alternate content is not cleared. commit 956c3ff3d43e1b181f7c91518edee1c7c4dc2a0a Author: Miklos Vajna vmik...@collabora.co.uk Date: Sun Oct 26 12:53:05 2014 +0100 fdo#82076 RTF import: handle footnote in table cell Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf diff --git a/sw/qa/extras/rtfimport/data/fdo82076.rtf b/sw/qa/extras/rtfimport/data/fdo82076.rtf new file mode 100644 index 000..20b33e9 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo82076.rtf @@ -0,0 +1,13 @@ +{\rtf1 +\pard\plain +Before +\par +\trowd \cellx4000\cellx8000 +A1\cell +B1 +{\chftn +{\footnote Footnote} +} +\cell\row +\pard After\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 6ecd7a3..90ae2ef 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1996,6 +1996,17 @@
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/rtfexport/data/fdo82860.odt |binary sw/qa/extras/rtfexport/rtfexport.cxx | 10 + sw/source/filter/ww8/rtfattributeoutput.cxx | 122 +- sw/source/filter/ww8/rtfattributeoutput.hxx |3 sw/source/filter/ww8/rtfexport.cxx| 25 sw/source/filter/ww8/rtfexport.hxx|8 + sw/source/filter/ww8/rtfsdrexport.cxx | 31 + sw/source/filter/ww8/rtfsdrexport.hxx |8 + writerfilter/source/dmapper/DomainMapper_Impl.cxx | 30 +++-- 9 files changed, 175 insertions(+), 62 deletions(-) New commits: commit 5a5d55a8a0f82406a8001015a723596f21d3562c Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Oct 15 13:00:24 2014 +0200 fdo#82860 RTF import: fix handling of SHAPE fields No need to use fieldmarks for these. Change-Id: I8d2c797f2b00be88e445dab0dd69cb1a9556c02c diff --git a/sw/qa/extras/rtfexport/data/fdo82860.odt b/sw/qa/extras/rtfexport/data/fdo82860.odt new file mode 100644 index 000..f680410 Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo82860.odt differ diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 5c74c53..2ffbb38 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -709,6 +709,16 @@ DECLARE_RTFEXPORT_TEST(testNumberingFont, numbering-font.rtf) CPPUNIT_ASSERT_EQUAL(OUString(Verdana), getPropertyOUString(xStyle, CharFontName)); } +DECLARE_RTFEXPORT_TEST(testFdo82860, fdo82860.odt) +{ +// The problem was that: +// 1) The import tried to use fieldmarks for SHAPE fields +// 2) The exporter did not handle shape with textbox text. +uno::Referencetext::XTextRange xTextRange(getShape(1), uno::UNO_QUERY); +uno::Referencetext::XText xText = xTextRange-getText(); +CPPUNIT_ASSERT_EQUAL(OUString(hello), getParagraphOfText(1, xText)-getString()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 8bdf7f7..adee004 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4001,20 +4001,26 @@ void DomainMapper_Impl::CloseFieldCommand() * To handle unsupported fields used fieldmark API. */ OUString aCode( pContext-GetCommand().trim() ); -xFieldInterface = m_xTextFactory-createInstance(com.sun.star.text.Fieldmark); -const uno::Referencetext::XTextContent xTextContent(xFieldInterface, uno::UNO_QUERY_THROW); -uno::Reference text::XTextAppend xTextAppend; -xTextAppend = m_aTextAppendStack.top().xTextAppend; -uno::Reference text::XTextCursor xCrsr = xTextAppend-createTextCursorByRange(pContext-GetStartRange()); -if (xTextContent.is()) +// Don't waste resources on wrapping shapes inside a fieldmark. +if (aCode != SHAPE) { -xTextAppend-insertTextContent(xCrsr,xTextContent, sal_True); +xFieldInterface = m_xTextFactory-createInstance(com.sun.star.text.Fieldmark); +const uno::Referencetext::XTextContent xTextContent(xFieldInterface, uno::UNO_QUERY_THROW); +uno::Reference text::XTextAppend xTextAppend; +xTextAppend = m_aTextAppendStack.top().xTextAppend; +uno::Reference text::XTextCursor xCrsr = xTextAppend-createTextCursorByRange(pContext-GetStartRange()); +if (xTextContent.is()) +{ +xTextAppend-insertTextContent(xCrsr,xTextContent, sal_True); +} +const uno::Referenceuno::XInterface xContent(xTextContent); +uno::Reference text::XFormField xFormField(xContent, uno::UNO_QUERY); +xFormField-setFieldType(aCode); +m_bStartGenericField = true; +pContext-SetFormField( xFormField ); } -const uno::Referenceuno::XInterface xContent(xTextContent); -uno::Reference text::XFormField xFormField(xContent, uno::UNO_QUERY); -xFormField-setFieldType(aCode); -m_bStartGenericField = true; -pContext-SetFormField( xFormField ); +else +m_bParaHadField = false; } //set the text field if there is any pContext-SetTextField( uno::Reference text::XTextField ( xFieldInterface, uno::UNO_QUERY ) ); commit ecc5cbc69e4c2df4ddbe46bbc2f973cc60a10772 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Oct 15 12:35:47 2014 +0200 fdo#82860 RTF export: if
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx |binary sw/source/core/unocore/unoparagraph.cxx |2 +- writerfilter/source/dmapper/StyleSheetTable.cxx |3 ++- writerfilter/source/ooxml/modelpreprocess.py |4 4 files changed, 3 insertions(+), 6 deletions(-) New commits: commit 7c02c7b0216f642074b690cce889f1a02a2ef6b0 Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Aug 22 13:51:54 2014 +0200 DOCX import: list styles don't support automatic updates The problem was the following: setPropertyValue(IsAutoUpdate) on the style failed - a number of styles was not imported in StyleSheetTable::ApplyStyleSheets() due to the exception, then when we tried to use one of the not imported styles, we also got an exception in DomainMapper_Impl::finishParagraph(), which resulted in not calling DomainMapperTableManager::handle(), so multiple cells of the same table wanted the same range for cell contents, and that resulted in a crash. Regression from cf33af732ed0d3d553bb74636e3b14c55d44c153 (handle w:gridBefore by faking cells (fdo#38414), 2014-04-23), but that commit just made the previously hidden problem visible. Change-Id: I788cb6b4a2c7b7efbfa48297c658bb26450bf583 diff --git a/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx b/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx new file mode 100644 index 000..60dae2a Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/liststyle-gridbefore.docx differ diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 50e9b7e..1c39a8a 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1203,7 +1203,8 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) xPropertySet-setPropertyValue(StyleInteropGrabBag, uno::makeAny(aGrabBag)); } -if (pEntry-bAutoRedefine) +// List styles don't support automatic update. +if (pEntry-bAutoRedefine !bListStyle) xPropertySet-setPropertyValue(IsAutoUpdate, uno::makeAny(sal_True)); } else if(pEntry-nStyleTypeCode == STYLE_TYPE_TABLE) commit 2a029e5f4ec7992422a02c575581a8b321c3f578 Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Aug 22 10:55:06 2014 +0200 SwXParagraph::Impl::GetTxtNode: fix indenetation Change-Id: Iac9e2883067b6cf4fdc259110642002b4ef6e48c diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index c6c3e20..d83a19a 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -134,7 +134,7 @@ public: { } - SwTxtNode * GetTxtNode() { +SwTxtNode* GetTxtNode() { return static_castSwTxtNode*(GetRegisteredInNonConst()); } commit 8e9c34036220d9099386e83adb9a38ae008e1044 Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Aug 22 10:11:12 2014 +0200 writerfilter: unused namespacealias attribute Change-Id: I12f59c6d06323d3d9ebcd55ee5fe7e43597a11b4 diff --git a/writerfilter/source/ooxml/modelpreprocess.py b/writerfilter/source/ooxml/modelpreprocess.py index 246fae3..6b2e874 100644 --- a/writerfilter/source/ooxml/modelpreprocess.py +++ b/writerfilter/source/ooxml/modelpreprocess.py @@ -71,10 +71,6 @@ def check(model): def preprocess(model): for i in model.getElementsByTagName(namespace): ns = i.getElementsByTagName(grammar)[0].getAttribute(ns) -if ns in list(ooxUrlAliases.keys()): -i.setAttribute(namespacealias, ooxUrlAliases[ns]) -else: -i.setAttribute(namespacealias, ) if ns.startswith(http://schemas.openxmlformats.org/;): i.setAttribute(prefix, ns.replace('http://schemas.openxmlformats.org/', '').replace('/', '_').replace('-', '_')) else: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 12 ++ sw/source/filter/ww8/docxsdrexport.cxx | 29 +++ sw/source/filter/ww8/writerhelper.cxx | 30 sw/source/filter/ww8/writerhelper.hxx |3 + sw/source/filter/ww8/wrtw8esh.cxx | 27 -- writerfilter/source/ooxml/model.xml |1 7 files changed, 75 insertions(+), 27 deletions(-) New commits: commit b818256d1c0f467d1064a0ebc1b17d079e74f38a Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue Aug 12 16:48:27 2014 +0200 DOCX export: handle wrap polygon around pictures Change-Id: I83d9d42cd48ba4dcd86c6506c7dbd6493bb4d204 diff --git a/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx b/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx new file mode 100644 index 000..f858a05 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/picture-wrap-polygon.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index fc4c1c2..7dfa7ad 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -18,6 +18,7 @@ #include com/sun/star/drawing/Hatch.hpp #include com/sun/star/drawing/LineJoint.hpp #include com/sun/star/drawing/LineStyle.hpp +#include com/sun/star/drawing/PointSequenceSequence.hpp #include com/sun/star/drawing/TextVerticalAdjust.hpp #include com/sun/star/style/LineSpacing.hpp #include com/sun/star/style/LineSpacingMode.hpp @@ -1792,6 +1793,17 @@ DECLARE_OOXMLEXPORT_TEST(testWrapTightThrough, wrap-tight-through.docx) } } +DECLARE_OOXMLEXPORT_TEST(testPictureWrapPolygon, picture-wrap-polygon.docx) +{ +// The problem was that the wrap polygon was ignored during export. +drawing::PointSequenceSequence aSeqSeq = getPropertydrawing::PointSequenceSequence(getShape(1), ContourPolyPolygon); +// This was 0: the polygon list was empty. +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aSeqSeq.getLength()); + +drawing::PointSequence aSeq = aSeqSeq[0]; +CPPUNIT_ASSERT_EQUAL(sal_Int32(11), aSeq.getLength()); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 7265745..2c1f7bc 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -51,6 +51,7 @@ #include IDocumentDrawModelAccess.hxx +#include writerhelper.hxx using namespace com::sun::star; using namespace oox; @@ -682,6 +683,34 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size rS } } +// Or if we have a contour. +if (!nWrapToken pFrmFmt-GetSurround().IsContour()) +{ +if (const SwNoTxtNode* pNd = sw::util::GetNoTxtNodeFromSwFrmFmt(*pFrmFmt)) +{ +const PolyPolygon* pPolyPoly = pNd-HasContour(); +if (pPolyPoly pPolyPoly-Count()) +{ +nWrapToken = XML_wrapTight; +m_pImpl-m_pSerializer-startElementNS(XML_wp, nWrapToken, + XML_wrapText, bothSides, FSEND); + +m_pImpl-m_pSerializer-startElementNS(XML_wp, XML_wrapPolygon, + XML_edited, 0, + FSEND); +Polygon aPoly = sw::util::CorrectWordWrapPolygonForExport(*pPolyPoly, pNd); +for (sal_uInt16 i = 0; i aPoly.GetSize(); ++i) +m_pImpl-m_pSerializer-singleElementNS(XML_wp, (i == 0 ? XML_start : XML_lineTo), +XML_x, OString::number(aPoly[i].X()), +XML_y, OString::number(aPoly[i].Y()), +FSEND); +m_pImpl-m_pSerializer-endElementNS(XML_wp, XML_wrapPolygon); + +m_pImpl-m_pSerializer-endElementNS(XML_wp, nWrapToken); +} +} +} + // No? Then just approximate based on what we have. if (isAnchor !nWrapToken) { commit 959a843f48be63071c64ba9e20c9389ebc390e81 Author: Miklos Vajna vmik...@collabora.co.uk Date: Tue Aug 12 11:40:13 2014 +0200 DOC export: factor out wrap polygon handling to to sw::util So that it'll be possible to reuse it in the DOCX exporter. Change-Id: Ib7371c92c4fd93d7c6f3271ca81311bac8f1a1a7 diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 015b076..85891c3 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -660,6 +660,36 @@ namespace sw } } +Polygon
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/para-shading.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx| 14 sw/source/filter/ww8/docxattributeoutput.cxx| 59 +- writerfilter/source/ooxml/model.xml | 492 4 files changed, 286 insertions(+), 279 deletions(-) New commits: commit 6e31cbb4eaea3c6600248ba59a22853acc1d6606 Author: Miklos Vajna vmik...@collabora.co.uk Date: Thu Aug 7 13:46:37 2014 +0200 DOCX export: avoid empty attributes in paragraph shading Change-Id: I4bdf3f2d7f2aee3ce735a52185e736a8861d85e4 diff --git a/sw/qa/extras/ooxmlexport/data/para-shading.docx b/sw/qa/extras/ooxmlexport/data/para-shading.docx new file mode 100644 index 000..9c2af1a Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/para-shading.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index b242714..6cd31bc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3474,6 +3474,20 @@ DECLARE_OOXMLEXPORT_TEST(testFdo80902, fdo80902.docx) assertXPath(pXmlDoc, /w:document/w:body/w:sectPr/w:docGrid, type, lines); } +DECLARE_OOXMLEXPORT_TEST(testParaShading, para-shading.docx) +{ +// Make sure the themeColor attribute is not written when it would be empty. +if (xmlDocPtr pXmlDoc = parseExport(word/document.xml)) +{ +xmlXPathObjectPtr pXPath = getXPathNode(pXmlDoc, /w:document/w:body/w:p/w:pPr/w:shd); +xmlNodeSetPtr pXmlNodes = pXPath-nodesetval; +CPPUNIT_ASSERT_EQUAL(1, xmlXPathNodeSetGetLength(pXmlNodes)); +xmlNodePtr pXmlNode = pXmlNodes-nodeTab[0]; +// The attribute existed, so xmlGetProp() returned non-NULL. +CPPUNIT_ASSERT_EQUAL(static_castxmlChar*(0), xmlGetProp(pXmlNode, BAD_CAST(themeColor))); +} +} + DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter, first-header-footer.docx) { // Test import and export of a section's headerf/footerf properties. diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 2ba2b4b..cfd3ef4 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -7710,42 +7710,35 @@ void DocxAttributeOutput::ParaGrabBag(const SfxGrabBagItem rItem) { uno::Sequencebeans::PropertyValue aGrabBagSeq; i-second = aGrabBagSeq; -OUString sVal, sShdFill, sShdColor, -sThemeColor, sThemeTint, sThemeShade, -sThemeFill, sThemeFillTint, sThemeFillShade; + for (sal_Int32 j=0; j aGrabBagSeq.getLength(); ++j) { +OString sVal = OUStringToOString(aGrabBagSeq[j].Value.getOUString(), RTL_TEXTENCODING_UTF8); + +if (sVal.isEmpty()) +continue; + if (aGrabBagSeq[j].Name == val) -aGrabBagSeq[j].Value = sVal; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_val), sVal.getStr()); else if (aGrabBagSeq[j].Name == color) -aGrabBagSeq[j].Value = sShdColor; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_color), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeColor) -aGrabBagSeq[j].Value = sThemeColor; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeColor), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeTint) -aGrabBagSeq[j].Value = sThemeTint; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeTint), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeShade) -aGrabBagSeq[j].Value = sThemeShade; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeShade), sVal.getStr()); else if (aGrabBagSeq[j].Name == fill) -aGrabBagSeq[j].Value = sShdFill; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_fill), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeFill) -aGrabBagSeq[j].Value = sThemeFill; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeFill), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeFillTint) -aGrabBagSeq[j].Value = sThemeFillTint; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeFillTint), sVal.getStr()); else if (aGrabBagSeq[j].Name == themeFillShade) -aGrabBagSeq[j].Value = sThemeFillShade; +AddToAttrList(m_pBackgroundAttrList, FSNS(XML_w, XML_themeFillShade), sVal.getStr()); else if (aGrabBagSeq[j].Name == originalColor) aGrabBagSeq[j].Value =
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport.cxx |4 sw/source/filter/ww8/docxattributeoutput.cxx |9 - writerfilter/source/dmapper/SdtHelper.cxx| 21 ++--- 3 files changed, 22 insertions(+), 12 deletions(-) New commits: commit e400b3af070d2ec592d78ce64ba10bc5f091ce6a Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jul 18 16:46:43 2014 +0200 DOCX export: handle w:alias for the date SDT Change-Id: I97d4331a5e49815cc03e8579b50a076b37530f96 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index e7934b2..87fdbd6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3360,8 +3360,12 @@ DECLARE_OOXMLEXPORT_TEST(testSdtAlias, sdt-alias.docx) DECLARE_OOXMLEXPORT_TEST(testSdtDateCharformat, sdt-date-charformat.docx) { if (xmlDocPtr pXmlDoc = parseExport()) +{ // character formatting (bold) was missing, this was 0 assertXPath(pXmlDoc, /w:document/w:body/w:p/w:sdt/w:sdtContent/w:r/w:rPr/w:b, 1); +// alias was also missing. +assertXPath(pXmlDoc, /w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias, 1); +} } DECLARE_OOXMLEXPORT_TEST(testFooterBodyDistance, footer-body-distance.docx) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 92e4a96..dcdb99a 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4216,7 +4216,7 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) // gather component properties Date aOriginalDate(Date::EMPTY); -OUString sOriginalContent, sDateFormat; +OUString sOriginalContent, sDateFormat, sAlias; OUString sLocale(en-US); uno::Sequencebeans::PropertyValue aGrabBag; uno::Referencebeans::XPropertySet xShapePropertySet(pFormObj-getUnoShape(), uno::UNO_QUERY); @@ -4241,6 +4241,8 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) } else if (aGrabBag[i].Name == CharFormat) aGrabBag[i].Value = aCharFormat; +else if (aGrabBag[i].Name == ooxml:CT_SdtPr_alias) +aGrabBag[i].Value = sAlias; } } uno::Referencebeans::XPropertySet xPropertySet(xControlModel, uno::UNO_QUERY); @@ -4274,6 +4276,11 @@ void DocxAttributeOutput::WritePostponedFormControl(const SdrObject* pObject) m_pSerializer-startElementNS(XML_w, XML_sdt, FSEND); m_pSerializer-startElementNS(XML_w, XML_sdtPr, FSEND); +if (!sAlias.isEmpty()) +m_pSerializer-singleElementNS(XML_w, XML_alias, + FSNS(XML_w, XML_val), OUStringToOString(sAlias, RTL_TEXTENCODING_UTF8), + FSEND); + if (bHasDate) m_pSerializer-startElementNS(XML_w, XML_date, FSNS( XML_w, XML_fullDate ), sDate.getStr(), commit 085ab61bfd63d7610f2ccc52aa2483d795c9bc1a Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jul 18 16:41:09 2014 +0200 DOCX import: handle w:alias for the date SDT Change-Id: I4a58fd9fc1db4e0fd3f9e2142fc208cec9f99f9d diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 18c3c06..2b1a111 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -128,6 +128,8 @@ void SdtHelper::createDateControl(OUString rContentText, beans::PropertyValue a aGrabBag[DateFormat] = sDateFormat; aGrabBag[Locale] = m_sLocale.makeStringAndClear(); aGrabBag[CharFormat] = aCharFormat.Value; +// merge in properties like ooxml:CT_SdtPr_alias and friends. +aGrabBag.update(comphelper::SequenceAsHashMap(m_aGrabBag)); std::vectorOUString aItems; createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), rContentText, aItems), xControlModel, aGrabBag.getAsConstPropertyValueList()); commit 7916ca62209ee32c46c264b8cbf0a28b1c23a2a8 Author: Miklos Vajna vmik...@collabora.co.uk Date: Fri Jul 18 16:38:45 2014 +0200 Use comphelper::SequenceAsHashMap Change-Id: I398881187001393a84e407157041d3a7d254b708 diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index aeb129d..18c3c06 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -12,6 +12,7 @@ #include com/sun/star/drawing/XControlShape.hpp #include com/sun/star/text/VertOrientation.hpp +#include comphelper/sequenceashashmap.hxx
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/README | 19 ++ sw/qa/extras/ooxmlexport/data/fdo79817.docx |binary sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx| 35 +--- sw/source/filter/ww8/docxattributeoutput.cxx|2 + writerfilter/source/dmapper/DomainMapper.cxx| 12 +- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 15 ++-- writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 + 8 files changed, 61 insertions(+), 25 deletions(-) New commits: commit 033f59dad00d449fec8b8eccf8674ee59d8e Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jul 16 11:27:33 2014 +0200 sw/qa/extras/README: document how to run a single test This was already documented in the code, but first it got copypasted several times, then now it's hidden in a header, so not so easy to find. Change-Id: I6c6814a14bb6208d9f31ee66f0c0f9b843ee7157 diff --git a/sw/qa/extras/README b/sw/qa/extras/README index fbc6aac..1959f68 100644 --- a/sw/qa/extras/README +++ b/sw/qa/extras/README @@ -128,6 +128,25 @@ uno::Referencebeans::XPropertySet xStyle(getStyles(PageStyles)-getByName(DE CPPUNIT_ASSERT_EQUAL(true, getPropertybool(xStyle, IsLandscape)); +== CppUnit tips + +=== sal_Bool + +In case an UNO method returns sal_Bool, and the assert fails, CppUnit won't be +able to print a usable error message, as it will think that the value is a +printable character. Best to use `bool` for the expected value and cast the +actual value to `bool` as well before comparing. + +=== Running only a single test + +If you want to run only a single test to allow quick development iteration, +then you need to do two things: + +- change the `#if 1` in `inc/swmodeltestbase.hxx` to `#if 0` to define the test + macro with the `_ONLY` suffix +- change the used macro for the test you want to run, i.e. + `DECLARE_OOXMLEXPORT_TEST` - `DECLARE_OOXMLEXPORT_TEST_ONLY` + == UNO, in more details, various tips: === writing code based xray inspection: commit b2bc4ea8ddae6b01f344469d988e21fed3143c42 Author: Miklos Vajna vmik...@collabora.co.uk Date: Wed Jul 16 10:46:38 2014 +0200 DOCX import: handle SDT around citation field There were two problems here: 1) Citation field was around a run, but was exported as around the paragraph. 2) The SDT properties were discarded, as they were inserted into a character context that was thrown away. To fix this, add a (character properties) context to the field state, so when it's inserted, it can have the requested properties. Change-Id: Ic36deff616060f049147874633c6c7264ae8ecf2 diff --git a/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx b/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx new file mode 100644 index 000..cd97f93 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-citation-run.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 646bf57..0e69a54 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2903,7 +2903,7 @@ DECLARE_OOXMLEXPORT_TEST(test_FieldType, 99_Fields.docx) // Checking for three field types (BIBLIOGRAPHY, BIDIOUTLINE, CITATION) in sequence assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:p[2]/w:r[2]/w:instrText[1],1); assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:p[5]/w:r[2]/w:instrText[1],1); -assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText[1],1); +assertXPath(pXmlDoc, /w:document[1]/w:body[1]/w:p/w:sdt/w:sdtContent/w:r[2]/w:instrText[1],1); } DECLARE_OOXMLEXPORT_TEST(testComboBoxControl, combobox-control.docx) @@ -3002,8 +3002,8 @@ DECLARE_OOXMLEXPORT_TEST(testCitation,FDO74775.docx) xmlDocPtr pXmlDoc = parseExport(); if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, /w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[3]/w:instrText, CITATION Kra06 \\l 1033 ); -assertXPathContent(pXmlDoc, /w:document/w:body/w:sdt/w:sdtContent/w:p[1]/w:r[5]/w:t, (Kramer Chen, 2006)); +assertXPathContent(pXmlDoc, /w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[2]/w:instrText, CITATION Kra06 \\l 1033 ); +assertXPathContent(pXmlDoc, /w:document/w:body/w:p[1]/w:sdt/w:sdtContent/w:r[4]/w:t, (Kramer Chen, 2006)); } DECLARE_OOXMLEXPORT_TEST(testFdo76016, fdo76016.docx) @@ -3101,11 +3101,11 @@ DECLARE_OOXMLEXPORT_TEST(testSimpleSdts, simple-sdts.docx) if (!pXmlDoc) return; -assertXPath(pXmlDoc, /w:document/w:body/w:p/w:sdt/w:sdtPr/w:text, 1); -assertXPath(pXmlDoc, /w:document/w:body/w:p/w:sdt/w:sdtPr/w:id, 1); +assertXPath(pXmlDoc, /w:document/w:body/w:p[1]/w:sdt/w:sdtPr/w:text, 1); +assertXPath(pXmlDoc, /w:document/w:body/w:p[2]/w:sdt/w:sdtPr/w:id, 1); assertXPath(pXmlDoc,
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/rtfimport/rtfimport.cxx |3 ++- sw/source/core/doc/docbm.cxx |2 ++ writerfilter/source/ooxml/efforts.sh | 20 3 files changed, 4 insertions(+), 21 deletions(-) New commits: commit 17fa344d034df1a1179b4e5961ec3001402a6df1 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat May 24 22:00:05 2014 +0200 coverity#1158081 Unchecked dynamic_cast Change-Id: Ia67656ac35d50c1f70045ff8e9084bcc54b0d9a8 diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 901ac71..21de483 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -573,6 +573,8 @@ namespace sw { namespace mark ++ppMark) { ::sw::mark::MarkBase* pMark = dynamic_cast ::sw::mark::MarkBase* (ppMark-get()); +if (!pMark) +continue; // is on position ?? bool bChangedPos = false; if(pMark-GetMarkPos().nNode.GetNode() == pOldNode) commit 8617afc0a88789722202cd0f30678eaee6c95580 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat May 24 21:55:34 2014 +0200 writerfilter: unused efforts.sh Change-Id: Ide86e29584faeff1d4b8a7d6d8a9a59acc725bd4 diff --git a/writerfilter/source/ooxml/efforts.sh b/writerfilter/source/ooxml/efforts.sh deleted file mode 100755 index e2c58e2..000 --- a/writerfilter/source/ooxml/efforts.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the License); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -./status.sh | xmllint --format - | xsltproc todo.xsl - | xsltproc effort.xsl - commit 1c14618eaf7c2cc15f060733d6f88a5d4ed132f9 Author: Miklos Vajna vmik...@collabora.co.uk Date: Sat May 24 21:53:19 2014 +0200 CppunitTest_sw_rtfimport: the point here was only that this was nearly zero If the old width was that small, then something larger should be also fine. (Seen 564 instead of 423.) Change-Id: Ife0fd4a55738268cdc1691b90e28b51adba829ef diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index e96f037..0284736 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -821,7 +821,8 @@ DECLARE_RTFIMPORT_TEST(testFdo52989, fdo52989.rtf) { // Same as n#192129, but for JPEG files. uno::Referencedrawing::XShape xShape(getShape(1), uno::UNO_QUERY); -CPPUNIT_ASSERT_EQUAL(sal_Int32(423), xShape-getSize().Width); +// This was 2, should be 423. +CPPUNIT_ASSERT(xShape-getSize().Width = 423); } DECLARE_RTFIMPORT_TEST(testFdo48442, fdo48442.rtf) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/ooxmlexport.cxx |5 + sw/source/filter/ww8/docxattributeoutput.cxx | 86 +++ sw/source/filter/ww8/docxattributeoutput.hxx |2 writerfilter/source/dmapper/DomainMapper.cxx | 21 ++ writerfilter/source/dmapper/PropertyIds.cxx |3 writerfilter/source/dmapper/PropertyIds.hxx |3 6 files changed, 95 insertions(+), 25 deletions(-) New commits: commit 25dc9aaf693ba1e4aac75659f0762f5169c10f28 Author: Jacobo Aragunde Pérez jaragu...@igalia.com Date: Tue Dec 17 14:12:57 2013 +0100 ooxml: preserve font theme color shade property Change-Id: I40fa3f172f98b319a97a855231b854651be2d784 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 9cbaaf6..e8279c0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2062,6 +2062,8 @@ DECLARE_OOXMLEXPORT_TEST(testThemePreservation, theme-preservation.docx) // check theme font color value has been preserved assertXPath(pXmlDocument, /w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color, themeColor, accent3); +OUString sThemeShade = getXPath(pXmlDocument, /w:document/w:body/w:p[4]/w:r[1]/w:rPr/w:color, themeShade); +CPPUNIT_ASSERT_EQUAL(sThemeShade.toInt32(16), 0xbf); // check the themeFontLang values in settings file xmlDocPtr pXmlSettings = parseExport(word/settings.xml); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 7d32238..ff041dc 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6216,6 +6216,15 @@ void DocxAttributeOutput::CharGrabBag( const SfxGrabBagItem rItem ) m_pColorAttrList-add( FSNS( XML_w, XML_themeColor ), OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); } +else if ( i-first == CharThemeColorShade ) +{ +i-second = str; +if( !m_pColorAttrList ) +m_pColorAttrList = m_pSerializer-createAttrList(); + +m_pColorAttrList-add( FSNS( XML_w, XML_themeShade ), + OUStringToOString( str, RTL_TEXTENCODING_UTF8 ) ); +} else if( i-first == CharThemeFontNameCs || i-first == CharThemeFontNameAscii || i-first == CharThemeFontNameEastAsia || diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 357faa3..1ee9e2d 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3110,6 +3110,8 @@ void DomainMapper::sprmWithProps( Sprm rSprm, PropertyMapPtr rContext, SprmType m_pImpl-GetTopContext()-Insert(PROP_CHAR_THEME_ORIGINAL_COLOR, aIter-Value, true, CHAR_GRAB_BAG); else if (aIter-Name == themeColor) m_pImpl-GetTopContext()-Insert(PROP_CHAR_THEME_COLOR, aIter-Value, true, CHAR_GRAB_BAG); +else if (aIter-Name == themeShade) + m_pImpl-GetTopContext()-Insert(PROP_CHAR_THEME_COLOR_SHADE, aIter-Value, true, CHAR_GRAB_BAG); } if (m_pImpl-m_aInteropGrabBagName == TempColorPropsGrabBag) { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index a38b19c..8916ff8 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -357,6 +357,7 @@ const OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_CHAR_THEME_FONT_NAME_EAST_ASIA: sName = CharThemeFontNameEastAsia; break; case PROP_CHAR_THEME_COLOR : sName = CharThemeColor; break; case PROP_CHAR_THEME_ORIGINAL_COLOR : sName = CharThemeOriginalColor; break; +case PROP_CHAR_THEME_COLOR_SHADE: sName = CharThemeColorShade; break; } ::std::pairPropertyNameMap_t::iterator,bool aInsertIt = m_pImpl-aNameMap.insert( PropertyNameMap_t::value_type( eId, sName )); diff --git a/writerfilter/source/dmapper/PropertyIds.hxx b/writerfilter/source/dmapper/PropertyIds.hxx index e804686..8f1fa11 100644 --- a/writerfilter/source/dmapper/PropertyIds.hxx +++ b/writerfilter/source/dmapper/PropertyIds.hxx @@ -328,6 +328,7 @@ enum PropertyIds ,PROP_CHAR_THEME_FONT_NAME_EAST_ASIA ,PROP_CHAR_THEME_COLOR ,PROP_CHAR_THEME_ORIGINAL_COLOR +,PROP_CHAR_THEME_COLOR_SHADE }; struct PropertyNameSupplier_Impl; class PropertyNameSupplier commit 3d126bcf1febe68919eab42c5cd2cd0d7db2f66b Author: Jacobo Aragunde Pérez jaragu...@igalia.com Date: Tue Dec 17 13:19:16 2013 +0100 ooxml: preserve font theme color property The property is called w:themeColor and it belongs to the
[Libreoffice-commits] core.git: 3 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/bnc837302.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 32 ++ sw/source/core/doc/docredln.cxx |3 -- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 14 + 4 files changed, 47 insertions(+), 2 deletions(-) New commits: commit 919d4a2c5977bb6066e5baf6bb960a21cd385911 Author: Jan Holesovsky ke...@collabora.com Date: Wed Nov 20 13:39:18 2013 +0100 Related bnc#837302: Don't introduce a redlined delete and the end of doc. Change-Id: I5c3903a40b69867684707d33acbc92b1f80a93ec diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 13245c3..da830d6 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1170,6 +1170,17 @@ DECLARE_OOXMLEXPORT_TEST(testBnc837302, bnc837302.docx) getRun(xParagraph, 3, AAA); // interestingly the 'Insert' is set on the _previous_ run CPPUNIT_ASSERT_EQUAL(OUString(Insert), getPropertyOUString(getRun(xParagraph, 2), RedlineType)); + +// make sure we don't introduce a redlined delete in the 2nd paragraph +xParagraph = getParagraph(2); +OUString aProperty; +try +{ +// throws when not present +aProperty = getPropertyOUString(getRun(xParagraph, 1), RedlineType); +} +catch (const beans::UnknownPropertyException) {} +CPPUNIT_ASSERT_EQUAL(OUString(), aProperty); } DECLARE_OOXMLEXPORT_TEST(testFdo68418, fdo68418.docx) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index cc2486b..d88ca49 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -300,7 +300,21 @@ void DomainMapper_Impl::RemoveLastParagraph( ) // If this is a text on a shape, possibly the text has the trailing // newline removed already. if (xCursor-getString() == \n) +{ +uno::Referencebeans::XPropertySet xDocProps(GetTextDocument(), uno::UNO_QUERY); +const OUString aRecordChanges(RecordChanges); +uno::Any aPreviousValue(xDocProps-getPropertyValue(aRecordChanges)); + +// disable redlining for this operation, otherwise we might +// end up with an unwanted recorded deletion +xDocProps-setPropertyValue(aRecordChanges, uno::Any(sal_False)); + +// delete xCursor-setString(OUString()); + +// restore again +xDocProps-setPropertyValue(aRecordChanges, aPreviousValue); +} } } catch( const uno::Exception ) commit 6e0aa783f4112791de336007343e064abc46324e Author: Jan Holesovsky ke...@collabora.com Date: Wed Nov 20 11:45:39 2013 +0100 bnc#837302: Allow insertion of redlines with an empty author. No idea why that was not allowed (since the initial import in 2000), we need it for interoperability. Change-Id: I475fa63f9a4a3219a2b898b6f7d81e0603d32c18 diff --git a/sw/qa/extras/ooxmlexport/data/bnc837302.docx b/sw/qa/extras/ooxmlexport/data/bnc837302.docx new file mode 100644 index 000..9d0c0af Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc837302.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index f20cecd..13245c3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -1161,6 +1161,17 @@ DECLARE_OOXMLEXPORT_TEST(testBnc834035, bnc834035.odt) assertXPath(pXmlDoc, /w:document/w:body/w:p[10]/w:hyperlink, anchor, _Toc363553908); } +DECLARE_OOXMLEXPORT_TEST(testBnc837302, bnc837302.docx) +{ +// The problem was that text with empty author was not inserted as a redline +uno::Referencetext::XTextRange xParagraph = getParagraph(1); + +// previously 'AAA' was not an own run +getRun(xParagraph, 3, AAA); +// interestingly the 'Insert' is set on the _previous_ run +CPPUNIT_ASSERT_EQUAL(OUString(Insert), getPropertyOUString(getRun(xParagraph, 2), RedlineType)); +} + DECLARE_OOXMLEXPORT_TEST(testFdo68418, fdo68418.docx) { // The problem was that in 'MSWordExportBase::SectionProperties' function in 'wrt8sty.cxx' diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 04bd747..ee4db26 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -290,8 +290,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) bool bMerged = false; _CHECK_REDLINE( this ) -if( IsRedlineOn() !IsShowOriginal( meRedlineMode ) -!pNewRedl-GetAuthorString().isEmpty() ) +if (IsRedlineOn() !IsShowOriginal(meRedlineMode)) { pNewRedl-InvalidateRange(); commit ae3cfef7ea13f49f442862aba5264fc8839dd863 Author: