[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/table-btlr-center.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 17 +++ writerfilter/source/dmapper/DomainMapperTableManager.cxx |7 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 6 files changed, 35 insertions(+) New commits: commit 3325e0f206ce864730468c3556ce06760042c157 Author: Miklos Vajna Date: Wed Jul 2 17:33:03 2014 +0200 bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx new file mode 100644 index 000..79cb53e Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b209755..6562b97 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2221,6 +2221,15 @@ DECLARE_OOXMLIMPORT_TEST(testFootnote, "footnote.docx") CPPUNIT_ASSERT(aFootnote.endsWith("bar")); } +DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +// Cell vertical alignment was NONE, should be CENTER. +CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 16b367c..8243bf6 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -826,6 +828,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } aCellIterator->get()->erase(PROP_HORIZONTAL_MERGE); } + +// Cell direction is not an UNO Property, either. +const PropertyMap::const_iterator aCellDirectionIter = aCellIterator->get()->find(PROP_CELL_DIRECTION); +if (aCellDirectionIter != aCellIterator->get()->end()) +{ +if (aCellDirectionIter->second.getValue().get() == 3) +{ +// btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. +uno::Reference xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); +if (xPropertySet->getPropertyValue("ParaAdjust").get() == style::ParagraphAdjust_CENTER) +aCellIterator->get()->Insert(PROP_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER)); +} +aCellIterator->get()->erase(PROP_CELL_DIRECTION); +} + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); #ifdef DEBUG_DOMAINMAPPER dmapper_logger->endElement(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 7502a84..d776561 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -328,6 +328,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TcPrBase_textDirection: { TablePropertyMapPtr pPropMap( new TablePropertyMap ); + +// Remember the cell direction, so later in +// DomainMapperTableHandler::endTableGetCellProperties() can we +// handle the combination of the cell direction and paragraph +// alignment as necessary. +pPropMap->Insert(PROP_CELL_DIRECTION, uno::Any(sal_Int32(3))); + bool bInsertCellProps = true; switch ( nIntValue ) { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index 66e1773..e5b9918 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -392,6 +392,7 @@ OUString PropertyNameSupplier::GetName( PropertyIds eId ) const case PROP_CELL_INTEROP_GRAB_BAG : sNam
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/table-btlr-center.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 17 +++ writerfilter/source/dmapper/DomainMapperTableManager.cxx |7 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 6 files changed, 35 insertions(+) New commits: commit 6e20fc2414a625f9f2419af6bbba46bccd93d2b1 Author: Miklos Vajna Date: Wed Jul 2 17:33:03 2014 +0200 bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d (cherry picked from commit 3325e0f206ce864730468c3556ce06760042c157) diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx new file mode 100644 index 000..79cb53e Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 88acef8..26e0e36 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1703,6 +1703,15 @@ DECLARE_OOXMLIMPORT_TEST(testFootnote, "footnote.docx") CPPUNIT_ASSERT(aFootnote.endsWith("bar")); } +DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +// Cell vertical alignment was NONE, should be CENTER. +CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0827cc9..7b8d9cd 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #ifdef DEBUG_DMAPPER_TABLE_HANDLER @@ -715,6 +717,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } aCellIterator->get()->erase(PROP_HORIZONTAL_MERGE); } + +// Cell direction is not an UNO Property, either. +const PropertyMap::const_iterator aCellDirectionIter = aCellIterator->get()->find(PROP_CELL_DIRECTION); +if (aCellDirectionIter != aCellIterator->get()->end()) +{ +if (aCellDirectionIter->second.getValue().get() == 3) +{ +// btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. +uno::Reference xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); +if (xPropertySet->getPropertyValue("ParaAdjust").get() == style::ParagraphAdjust_CENTER) +aCellIterator->get()->Insert(PROP_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER)); +} +aCellIterator->get()->erase(PROP_CELL_DIRECTION); +} + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); #ifdef DEBUG_DMAPPER_TABLE_HANDLER dmapper_logger->endElement(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 764a065..6a95be3 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -324,6 +324,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TcPrBase_textDirection: { TablePropertyMapPtr pPropMap( new TablePropertyMap ); + +// Remember the cell direction, so later in +// DomainMapperTableHandler::endTableGetCellProperties() can we +// handle the combination of the cell direction and paragraph +// alignment as necessary. +pPropMap->Insert(PROP_CELL_DIRECTION, uno::Any(sal_Int32(3))); + bool bInsertCellProps = true; switch ( nIntValue ) { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index bacbcd3..d693ddb 100644 --- a/writerfilter/source/dmapper/PropertyIds.cxx +++ b/writerfilter/source/dmapper/PropertyIds.cxx @@ -346,6 +346,7 @@ const OUS
[Libreoffice-commits] core.git: sax/source
sax/source/tools/fastserializer.hxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 0f6888a25b3d39eca2b7aac596121dc0128c7c6a Author: Miklos Vajna Date: Thu Jul 3 15:35:44 2014 +0200 FastSaxSerializer: update documentation Change-Id: I5e374c426a4741a88d43848392fc83e2368dbf92 diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx index fbbaede..da8c527 100644 --- a/sax/source/tools/fastserializer.hxx +++ b/sax/source/tools/fastserializer.hxx @@ -120,20 +120,20 @@ public: This is to be able to change the order of the data being written. If you need to write eg. - p, r, rPr, [something], /rPr, t, [text], /r, /p, + p, r, rPr, [something], /rPr, t, [text], /t, /r, /p, but get it in order p, r, t, [text], /t, rPr, [something], /rPr, /r, /p, simply do p, r, mark(), t, [text], /t, mark(), rPr, [something], /rPr, - mergeTopMarks( true ), mergeTopMarks(), /r, /p + mergeTopMarks( MERGE_MARKS_PREPEND ), mergeTopMarks( MERGE_MARKS_APPEND ), /r, /p and you are done. */ void mark( const Int32Sequence& aOrder = Int32Sequence() ); /** Merge 2 topmost marks. -There are 3 possibilities - prepend the top before the second top-most -mark, append it, or append it later; prepending brings the possibility +The possibilities: prepend the top before the second top-most +mark, append it, append it later or ignore; prepending brings the possibility to switch parts of the output, appending later allows to write some output in advance. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/font.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 61dca7f849a61daeceb68856766c43995d6794e5 Author: Miklos Vajna Date: Fri Jul 4 15:57:40 2014 +0200 vcl: printf -> SAL_INFO in Font::SetFillColor Change-Id: Icbe3d7f2dc8e25bfde6efc92435f1cef50a3b419 diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index b3daebd..a2fb925 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -300,8 +300,7 @@ void Font::SetFillColor( const Color& rColor ) if ( rColor.GetTransparency() ) mpImplFont->mbTransparent = true; if (GetUnderline() == UNDERLINE_SINGLE ) { -fprintf(stderr, "I'm setting a filling (from Font) of (%d,%d,%d) \n", -rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue()); +SAL_INFO("vcl.gdi", "I'm setting a filling (from Font) of (" << rColor.GetRed() << "," << rColor.GetGreen() << "," << rColor.GetBlue() << ")"); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |6 ++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- writerfilter/source/dmapper/OLEHandler.cxx | 10 -- writerfilter/source/dmapper/OLEHandler.hxx |4 +++- 5 files changed, 18 insertions(+), 4 deletions(-) New commits: commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5 Author: Miklos Vajna Date: Fri Jul 4 16:38:40 2014 +0200 bnc#884615 VML import: import OLE objects in header with background wrapping We already do this for drawingML shapes since commit 500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import: always set Opaque, 2013-12-04), make the VML / OLE case behave the same as well. Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55 diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx new file mode 100755 index 000..51ee5ca Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 22635f4..0aa8235 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1736,6 +1736,12 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79591, "fdo79591.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/mc:AlternateContent/mc:Fallback/w:pict/v:shape", "ID", ""); } +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ +// The problem was that the shape in the header wasn't in the background. +CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(1), "Opaque"))); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ea66861..98e14d7 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2217,7 +2217,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { -OLEHandlerPtr pOLEHandler( new OLEHandler ); +OLEHandlerPtr pOLEHandler( new OLEHandler(*this) ); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 1976a13..a07b443 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include +#include #include #include "GraphicHelpers.hxx" @@ -45,11 +46,12 @@ namespace dmapper { using namespace ::com::sun::star; -OLEHandler::OLEHandler() : +OLEHandler::OLEHandler(DomainMapper& rDomainMapper) : LoggedProperties(dmapper_logger, "OLEHandler"), m_nDxaOrig(0), m_nDyaOrig(0), -m_nWrapMode(1) +m_nWrapMode(1), +m_rDomainMapper(rDomainMapper) { } @@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) try { +// Shapes in the header or footer should be in the background. +if (m_rDomainMapper.IsInHeaderFooter()) +xShapeProps->setPropertyValue("Opaque", uno::makeAny(false)); + m_aShapeSize = xTempShape->getSize(); m_aShapePosition = xTempShape->getPosition(); diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 00b4d8a..9e22fc1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -40,6 +40,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class OLEHandler : public LoggedProperties @@ -63,6 +64,7 @@ class OLEHandler : public LoggedProperties ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; +DomainMapper& m_rDomainMapper; // Properties virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE; @@ -73,7 +75,7 @@ class OLEHandler : public LoggedProperties const OUString& sObjectName ); public: -OLEHandler(); +OLEHandler(DomainMapper& rDomainMapper); virtual ~OLEHandler(); inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; };
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |6 ++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- writerfilter/source/dmapper/OLEHandler.cxx | 10 -- writerfilter/source/dmapper/OLEHandler.hxx |4 +++- 5 files changed, 18 insertions(+), 4 deletions(-) New commits: commit c52cb57cc893a6b42d77ceb4cf08a3816824ca4f Author: Miklos Vajna Date: Fri Jul 4 16:38:40 2014 +0200 bnc#884615 VML import: import OLE objects in header with background wrapping We already do this for drawingML shapes since commit 500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import: always set Opaque, 2013-12-04), make the VML / OLE case behave the same as well. (cherry picked from commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5) Conflicts: sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55 diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx new file mode 100755 index 000..51ee5ca Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 456eae2..460d497 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2082,6 +2082,12 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") CPPUNIT_ASSERT(contents.match("15")); } +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ +// The problem was that the shape in the header wasn't in the background. +CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(1), "Opaque"))); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index a824f6e..eb0fb89 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3467,7 +3467,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { -OLEHandlerPtr pOLEHandler( new OLEHandler ); +OLEHandlerPtr pOLEHandler( new OLEHandler(*this) ); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 44e4f4b..1ace46d 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include +#include #include #include "GraphicHelpers.hxx" @@ -45,11 +46,12 @@ namespace dmapper { using namespace ::com::sun::star; -OLEHandler::OLEHandler() : +OLEHandler::OLEHandler(DomainMapper& rDomainMapper) : LoggedProperties(dmapper_logger, "OLEHandler"), m_nDxaOrig(0), m_nDyaOrig(0), -m_nWrapMode(1) +m_nWrapMode(1), +m_rDomainMapper(rDomainMapper) { } @@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) try { +// Shapes in the header or footer should be in the background. +if (m_rDomainMapper.IsInHeaderFooter()) +xShapeProps->setPropertyValue("Opaque", uno::makeAny(false)); + m_aShapeSize = xTempShape->getSize(); m_aShapePosition = xTempShape->getPosition(); diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 63e9207..d7106b1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -41,6 +41,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties @@ -64,13 +65,14 @@ class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; +DomainMapper& m_rDomainMapper; // Properties virtual void lcl_attribute(Id Name, Value & val); virtual void lcl_sprm(Sprm & sprm); public: -OLEHandler(); +OLEHandler(DomainMapper& rDomainMapper); virtual ~OLEHandler(); inline ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getShape( ) { return m_xShape; }; ___
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 17 - 1 file changed, 4 insertions(+), 13 deletions(-) New commits: commit 2ff63282f7bf61379d8b96e7180d5800b2f1e05e Author: Miklos Vajna Date: Sat Jul 5 10:18:31 2014 +0200 Use comphelper::SequenceAsHashMap Change-Id: I14cb8647ff4a53eeff14933cfc4a868a3ab3 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 1be8c91..4f8649f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include @@ -4168,7 +4169,7 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) case RTF_NOFCHARSWS: if (m_xDocumentProperties.is()) { -uno::Sequence aSet = m_xDocumentProperties->getDocumentStatistics(); +comphelper::SequenceAsHashMap aSeq = m_xDocumentProperties->getDocumentStatistics(); OUString aName; switch (nKeyword) { @@ -4190,18 +4191,8 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } if (!aName.isEmpty()) { -bool bFound = false; -int nLen = aSet.getLength(); -for (int i = 0; i < nLen; ++i) -if (aSet[i].Name.equals(aName)) -aSet[i].Value = uno::makeAny(sal_Int32(nParam)); -if (!bFound) -{ -aSet.realloc(nLen + 1); -aSet[nLen].Name = aName; -aSet[nLen].Value = uno::makeAny(sal_Int32(nParam)); -} -m_xDocumentProperties->setDocumentStatistics(aSet); +aSeq[aName] = uno::makeAny(sal_Int32(nParam)); + m_xDocumentProperties->setDocumentStatistics(aSeq.getAsConstNamedValueList()); } } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source
writerfilter/CustomTarget_source.mk |8 +- writerfilter/source/ooxml/qnametostr.py | 54 + writerfilter/source/ooxml/qnametostr.xsl | 94 --- 3 files changed, 58 insertions(+), 98 deletions(-) New commits: commit 483a36f49230f53b291ba1307c8a3ffcc24a3b12 Author: Miklos Vajna Date: Sat Jul 5 11:04:48 2014 +0200 writerfilter: convert qnametostr to Python Change-Id: Ie72afbb1a7d384386d3189dae8276444767aac53 diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index d991b47..a7413d0 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -77,7 +77,7 @@ writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperff writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py -writerfilter_SRC_ooxml_QNameToStr_xsl=$(writerfilter_SRC)/ooxml/qnametostr.xsl +writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py $(writerfilter_GEN_ooxml_Factory_cxx) : $(writerfilter_SRC)/ooxml/factoryimpl.xsl $(writerfilter_GEN_ooxml_Model_processed) @@ -109,9 +109,9 @@ $(writerfilter_GEN_ooxml_NamespaceIds_hxx) : $(writerfilter_SRC_ooxml_NamespaceI $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_ooxml_NamespaceIds_xsl) $(writerfilter_GEN_ooxml_Model_processed)) > $@ -$(writerfilter_GEN_ooxml_QNameToStr_cxx): $(writerfilter_SRC_ooxml_QNameToStr_xsl) $(writerfilter_SRC_ooxml_FactoryTools_xsl) $(writerfilter_GEN_ooxml_Model_processed) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_ooxml_QNameToStr_xsl) $(writerfilter_GEN_ooxml_Model_processed)) > $@ +$(writerfilter_GEN_ooxml_QNameToStr_cxx): $(writerfilter_SRC_ooxml_QNameToStr_py) $(writerfilter_GEN_ooxml_Model_processed) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) + $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $(writerfilter_SRC_ooxml_QNameToStr_py) $(writerfilter_GEN_ooxml_Model_processed)) > $@ $(writerfilter_GEN_ooxml_ResourceIds_hxx) : $(writerfilter_SRC_ooxml_ResourceIds_py) $(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) diff --git a/writerfilter/source/ooxml/qnametostr.py b/writerfilter/source/ooxml/qnametostr.py new file mode 100644 index 000..520f135 --- /dev/null +++ b/writerfilter/source/ooxml/qnametostr.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python +# +# 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/. +# + +from __future__ import print_function +import xml.sax +import sys + + +class ContentHandler(xml.sax.handler.ContentHandler): +def __init__(self): +self.tokens = [] + +def startDocument(self): +print(""" +#include "ooxml/resourceids.hxx" +#include "resourcemodel/QNameToString.hxx" + +namespace writerfilter +{ + +void QNameToString::init_ooxml() +{ +#ifdef DEBUG_DOMAINMAPPER +/* ooxml */ +""") + +def endDocument(self): +print("""#endif +} + +} +""") + +def startElement(self, name, attrs): +pass +for k, v in list(attrs.items()): +if k == "tokenid": +if v.startswith("ooxml:"): +token = v.replace('ooxml:', '') +if token not in self.tokens: +print("""mMap[NS_ooxml::LN_%s] = "ooxml:%s";""" % (token, token)) +self.tokens.append(token) + +parser = xml.sax.make_parser() +parser.setContentHandler(ContentHandler()) +parser.parse(sys.argv[1]) + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/writerfilter/source/ooxml/qnametostr.xsl b/writerfilter/source/ooxml/qnametostr.xsl deleted file mode 100644 index 8aec26d..000 --- a/writerfilter/source/ooxml/qnametostr.xsl +++ /dev/null @@ -1,94 +0,0 @@ - -http://www.w3.org/1999/XSL/Transform"; -xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" -xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" -xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" -xm
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/fdo73241.rtf |8 sw/qa/extras/rtfimport/rtfimport.cxx |6 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 3 files changed, 18 insertions(+) New commits: commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816 Author: Miklos Vajna Date: Sat Jul 5 13:01:38 2014 +0200 fdo#73241 RTF import: ignore page break in tables Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15 diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf b/sw/qa/extras/rtfimport/data/fdo73241.rtf new file mode 100644 index 000..b919e25 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo73241.rtf @@ -0,0 +1,8 @@ +{\rtf1 +\pard\plain Before.\par +\trowd \cellx4703\cellx9514\pard\plain\intbl +{\page First cell\cell Second cell\cell } +\pard\plain \intbl +{\trowd \cellx4703\cellx9514\row } +\pard\plain After.\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 81b88bb..0adabdc 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1768,6 +1768,12 @@ DECLARE_RTFIMPORT_TEST(testColumnBreak, "column-break.rtf") CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty(getParagraph(2), "BreakType")); } +DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") +{ +// This was 2, page break in table wasn't ignored. +CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + 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 4f8649f..021a626 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2261,6 +2261,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_PAGE: { +// Ignore page breaks inside tables. +if (m_aStates.top().pCurrentBuffer == &m_aTableBufferStack.back()) +break; + // If we're inside a continuous section, we should send a section break, not a page one. RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type); // Unless we're on a title page. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/fdo73241.rtf |8 sw/qa/extras/rtfimport/rtfimport.cxx |6 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 3 files changed, 18 insertions(+) New commits: commit 197e9fb4e7fa857d764bcd66a97474c393d8308f Author: Miklos Vajna Date: Sat Jul 5 13:01:38 2014 +0200 fdo#73241 RTF import: ignore page break in tables (cherry picked from commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15 Reviewed-on: https://gerrit.libreoffice.org/10093 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf b/sw/qa/extras/rtfimport/data/fdo73241.rtf new file mode 100644 index 000..b919e25 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo73241.rtf @@ -0,0 +1,8 @@ +{\rtf1 +\pard\plain Before.\par +\trowd \cellx4703\cellx9514\pard\plain\intbl +{\page First cell\cell Second cell\cell } +\pard\plain \intbl +{\trowd \cellx4703\cellx9514\row } +\pard\plain After.\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index ee7d971..73ac0c9 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1664,6 +1664,12 @@ DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(getRun(getParagraph(1), 1), "CharFontName")); } +DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") +{ +// This was 2, page break in table wasn't ignored. +CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + 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 dd14ca5..66abe80 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2193,6 +2193,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_PAGE: { +// Ignore page breaks inside tables. +if (m_aStates.top().pCurrentBuffer == &m_aTableBufferStack.back()) +break; + // If we're inside a continous section, we should send a section break, not a page one. RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_sprm::LN_SBkc); // Unless we're on a title page. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/table-btlr-center.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 17 +++ writerfilter/source/dmapper/DomainMapperTableManager.cxx |7 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 6 files changed, 35 insertions(+) New commits: commit c3d745207dcf023b96edf1426048c8ff96189470 Author: Miklos Vajna Date: Wed Jul 2 17:33:03 2014 +0200 bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d (cherry picked from commit 3325e0f206ce864730468c3556ce06760042c157) Reviewed-on: https://gerrit.libreoffice.org/10049 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx new file mode 100644 index 000..79cb53e Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 88acef8..26e0e36 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1703,6 +1703,15 @@ DECLARE_OOXMLIMPORT_TEST(testFootnote, "footnote.docx") CPPUNIT_ASSERT(aFootnote.endsWith("bar")); } +DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +// Cell vertical alignment was NONE, should be CENTER. +CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0827cc9..7b8d9cd 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #ifdef DEBUG_DMAPPER_TABLE_HANDLER @@ -715,6 +717,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } aCellIterator->get()->erase(PROP_HORIZONTAL_MERGE); } + +// Cell direction is not an UNO Property, either. +const PropertyMap::const_iterator aCellDirectionIter = aCellIterator->get()->find(PROP_CELL_DIRECTION); +if (aCellDirectionIter != aCellIterator->get()->end()) +{ +if (aCellDirectionIter->second.getValue().get() == 3) +{ +// btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. +uno::Reference xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); +if (xPropertySet->getPropertyValue("ParaAdjust").get() == style::ParagraphAdjust_CENTER) +aCellIterator->get()->Insert(PROP_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER)); +} +aCellIterator->get()->erase(PROP_CELL_DIRECTION); +} + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); #ifdef DEBUG_DMAPPER_TABLE_HANDLER dmapper_logger->endElement(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 764a065..6a95be3 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -324,6 +324,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TcPrBase_textDirection: { TablePropertyMapPtr pPropMap( new TablePropertyMap ); + +// Remember the cell direction, so later in +// DomainMapperTableHandler::endTableGetCellProperties() can we +// handle the combination of the cell direction and paragraph +// alignment as necessary. +pPropMap->Insert(PROP_CELL_DIRECTION, uno::Any(sal_Int32(3))); + bool bInsertCellProps = true; switch ( nIntValue ) { diff --git a/writerfilter/source/dmapper/PropertyIds.cxx b/writerfilter/source/dmapper/PropertyIds.cxx index bacbcd3..d693ddb 100644 --- a/writerf
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |6 ++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- writerfilter/source/dmapper/OLEHandler.cxx | 10 -- writerfilter/source/dmapper/OLEHandler.hxx |4 +++- 5 files changed, 18 insertions(+), 4 deletions(-) New commits: commit 2c163f8261fc7e66b83089db0a9db58246fc1f6d Author: Miklos Vajna Date: Fri Jul 4 16:38:40 2014 +0200 bnc#884615 VML import: import OLE objects in header with background wrapping We already do this for drawingML shapes since commit 500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import: always set Opaque, 2013-12-04), make the VML / OLE case behave the same as well. (cherry picked from commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5) Conflicts: sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55 Reviewed-on: https://gerrit.libreoffice.org/10090 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx new file mode 100755 index 000..51ee5ca Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ccb299d..bd8051a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2079,6 +2079,12 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") CPPUNIT_ASSERT(contents.match("15")); } +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ +// The problem was that the shape in the header wasn't in the background. +CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(1), "Opaque"))); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index b7fdc9b..ff8428f 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3467,7 +3467,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { -OLEHandlerPtr pOLEHandler( new OLEHandler ); +OLEHandlerPtr pOLEHandler( new OLEHandler(*this) ); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 44e4f4b..1ace46d 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include +#include #include #include "GraphicHelpers.hxx" @@ -45,11 +46,12 @@ namespace dmapper { using namespace ::com::sun::star; -OLEHandler::OLEHandler() : +OLEHandler::OLEHandler(DomainMapper& rDomainMapper) : LoggedProperties(dmapper_logger, "OLEHandler"), m_nDxaOrig(0), m_nDyaOrig(0), -m_nWrapMode(1) +m_nWrapMode(1), +m_rDomainMapper(rDomainMapper) { } @@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) try { +// Shapes in the header or footer should be in the background. +if (m_rDomainMapper.IsInHeaderFooter()) +xShapeProps->setPropertyValue("Opaque", uno::makeAny(false)); + m_aShapeSize = xTempShape->getSize(); m_aShapePosition = xTempShape->getPosition(); diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 63e9207..d7106b1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -41,6 +41,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties @@ -64,13 +65,14 @@ class WRITERFILTER_DLLPRIVATE OLEHandler : public LoggedProperties ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; +DomainMapper& m_rDomainMapper; // Properties virtual void lcl_attribute(Id Name, Value & val); virtual void lcl_sprm(Sprm & sprm); public: -OLEHandler(); +OLEHandler(DomainMapper& rDomainMapper); virtual
[Libreoffice-commits] core.git: sd/source
sd/source/ui/remotecontrol/BluetoothServer.cxx | 96 - 1 file changed, 47 insertions(+), 49 deletions(-) New commits: commit 957bd58163409263a5ea8e5c92a8b74be9340636 Author: Miklos Vajna Date: Sun Jul 6 12:15:26 2014 +0200 error: could not convert from 'void' to 'bool' coverity#1202762 fix probably wanted to handle the result of dbus_message_iter_init(), not the result of dbus_message_iter_init_append() Change-Id: I31de559b729421bace92b0a768cb218b072d7b4c diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index 7d586ca..5a7b914 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -769,27 +769,22 @@ setDBusBooleanProperty( DBusConnection *pConnection, DBusObject *pAdapter, DBusMessage *pMsg = pProperties->getMethodCall( "Set" ); DBusMessageIter itIn; -if(!dbus_message_iter_init_append( pMsg, &itIn )) +dbus_message_iter_init_append( pMsg, &itIn ); +const char* pInterface = "org.bluez.Adapter1"; +dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pInterface ); +dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pPropertyName ); + { -SAL_WARN( "sdremote.bluetooth", "error init dbus" ); +DBusMessageIter varIt; +dbus_message_iter_open_container( &itIn, DBUS_TYPE_VARIANT, +DBUS_TYPE_BOOLEAN_AS_STRING, &varIt ); +dbus_bool_t bDBusBoolean = bBoolean; +dbus_message_iter_append_basic( &varIt, DBUS_TYPE_BOOLEAN, &bDBusBoolean ); +dbus_message_iter_close_container( &itIn, &varIt ); } -else -{ -const char* pInterface = "org.bluez.Adapter1"; -dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pInterface ); -dbus_message_iter_append_basic( &itIn, DBUS_TYPE_STRING, &pPropertyName ); -{ -DBusMessageIter varIt; -dbus_message_iter_open_container( &itIn, DBUS_TYPE_VARIANT, - DBUS_TYPE_BOOLEAN_AS_STRING, &varIt ); -dbus_bool_t bDBusBoolean = bBoolean; -dbus_message_iter_append_basic( &varIt, DBUS_TYPE_BOOLEAN, &bDBusBoolean ); -dbus_message_iter_close_container( &itIn, &varIt ); -} +pMsg = sendUnrefAndWaitForReply( pConnection, pMsg ); -pMsg = sendUnrefAndWaitForReply( pConnection, pMsg ); -} if( !pMsg ) { SAL_WARN( "sdremote.bluetooth", "no valid reply / timeout" ); @@ -917,45 +912,48 @@ DBusHandlerResult ProfileMessageFunction } DBusMessageIter it; -dbus_message_iter_init(pMessage, &it); +if (!dbus_message_iter_init(pMessage, &it)) +SAL_WARN( "sdremote.bluetooth", "error init dbus" ); +else +{ +char* pPath; +dbus_message_iter_get_basic(&it, &pPath); +SAL_INFO("sdremote.bluetooth", "Adapter path:" << pPath); -char* pPath; -dbus_message_iter_get_basic(&it, &pPath); -SAL_INFO("sdremote.bluetooth", "Adapter path:" << pPath); +if (!dbus_message_iter_next(&it)) +SAL_WARN("sdremote.bluetooth", "not enough parameters passed"); -if (!dbus_message_iter_next(&it)) -SAL_WARN("sdremote.bluetooth", "not enough parameters passed"); +// DBUS_TYPE_UNIX_FD == 'h' -- doesn't exist in older versions +// of dbus (< 1.3?) hence defined manually for now +if ('h' == dbus_message_iter_get_arg_type(&it)) +{ -// DBUS_TYPE_UNIX_FD == 'h' -- doesn't exist in older versions -// of dbus (< 1.3?) hence defined manually for now -if ('h' == dbus_message_iter_get_arg_type(&it)) -{ +int nDescriptor; +dbus_message_iter_get_basic(&it, &nDescriptor); +std::vector* pCommunicators = (std::vector*) user_data; -int nDescriptor; -dbus_message_iter_get_basic(&it, &nDescriptor); -std::vector* pCommunicators = (std::vector*) user_data; +// Bluez gives us non-blocking sockets, but our code relies +// on blocking behaviour. +(void)fcntl(nDescriptor, F_SETFL, fcntl(nDescriptor, F_GETFL) & ~O_NONBLOCK); -
[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source
writerfilter/CustomTarget_source.mk|7 -- writerfilter/source/ooxml/namespaceids.py | 53 writerfilter/source/ooxml/namespaceids.xsl | 92 - writerfilter/source/ooxml/qnametostr.py|1 4 files changed, 56 insertions(+), 97 deletions(-) New commits: commit 785dc709d5d560666ef3150c4506286f4a20925b Author: Miklos Vajna Date: Sun Jul 6 12:42:54 2014 +0200 writerfilter: convert namespaceids to Python Change-Id: Ia57a41aba91f00f3c1fb63a82c9793bf43434afb diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index a7413d0..989a623 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -75,7 +75,6 @@ writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py writerfilter_SRC_ooxml_Model=$(writerfilter_SRC)/ooxml/model.xml -writerfilter_SRC_ooxml_NamespaceIds_xsl=$(writerfilter_SRC)/ooxml/namespaceids.xsl writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.py writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py @@ -105,9 +104,9 @@ $(writerfilter_GEN_ooxml_Model_processed) : $(writerfilter_SRC_ooxml_Preprocess_ $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $(writerfilter_SRC_ooxml_Preprocess_py) $(writerfilter_DEP_ooxml_Namespaces_txt) $(writerfilter_SRC_ooxml_Model)) > $@ -$(writerfilter_GEN_ooxml_NamespaceIds_hxx) : $(writerfilter_SRC_ooxml_NamespaceIds_xsl) $(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $(writerfilter_SRC_ooxml_NamespaceIds_xsl) $(writerfilter_GEN_ooxml_Model_processed)) > $@ +$(writerfilter_GEN_ooxml_NamespaceIds_hxx) : $(writerfilter_SRC)/ooxml/namespaceids.py $(writerfilter_GEN_ooxml_Model_processed) | $(writerfilter_WORK)/ooxml/.dir + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) + $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ $(writerfilter_GEN_ooxml_QNameToStr_cxx): $(writerfilter_SRC_ooxml_QNameToStr_py) $(writerfilter_GEN_ooxml_Model_processed) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) diff --git a/writerfilter/source/ooxml/namespaceids.py b/writerfilter/source/ooxml/namespaceids.py new file mode 100644 index 000..2135b48 --- /dev/null +++ b/writerfilter/source/ooxml/namespaceids.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# +# 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/. +# + +from __future__ import print_function +import xml.sax +import sys + + +class ContentHandler(xml.sax.handler.ContentHandler): +def __init__(self): +self.tokens = [] + +def startDocument(self): +print(""" +#ifndef INCLUDED_OOXML_NAMESPACESIDS_HXX +#define INCLUDED_OOXML_NAMESPACESIDS_HXX + +#include +#include +#include +#include + +#include + +namespace writerfilter { +namespace ooxml { +using namespace ::std; +using namespace ::com::sun::star; +""") + +def endDocument(self): +print(""" +}} +#endif //INCLUDED_OOXML_NAMESPACESIDS_HXX""") + +def startElement(self, name, attrs): +if name == "namespace-alias": +token = """const sal_uInt32 NS_%s = %s;""" % (attrs["alias"], attrs["id"]) +if token not in self.tokens: +self.tokens.append(token) +print(token) + +parser = xml.sax.make_parser() +parser.setContentHandler(ContentHandler()) +parser.parse(sys.argv[1]) + +# vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/writerfilter/source/ooxml/namespaceids.xsl b/writerfilter/source/ooxml/namespaceids.xsl deleted file mode 100644 index d92593d..000 --- a/writerfilter/source/ooxml/namespaceids.xsl +++ /dev/null @@ -1,92 +0,0 @@ - -http://www.w3.org/1999/XSL/Transform"; -xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" -xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" -xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" -xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/ooxmlw14export.cxx |4 1 file changed, 4 deletions(-) New commits: commit 0cda0eb741501463baa8e7f325fe04f4687050e0 Author: Miklos Vajna Date: Sun Jul 6 13:52:26 2014 +0200 CppunitTest_sw_ooxmlw14export: enable on Windows Change-Id: I24aff2ca59edb7c5e1ad342ff54e848b4d1ea280 diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx index 6cdd628..84b6945 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -9,8 +9,6 @@ #include -#if !defined(WNT) - #include class Test : public SwModelTestBase @@ -660,8 +658,6 @@ DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_InStyleXml, "TextEffects_InStyle.docx" } -#endif - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/inc writerfilter/source
writerfilter/inc/resourcemodel/WW8ResourceModel.hxx |6 - writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx |5 - writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx |5 - writerfilter/source/ooxml/factoryimpl.xsl | 63 writerfilter/source/rtftok/rtfsprm.cxx |5 - writerfilter/source/rtftok/rtfsprm.hxx |1 6 files changed, 85 deletions(-) New commits: commit f46e392050a949c2d573b768eeb70d94fff550c2 Author: Miklos Vajna Date: Sun Jul 6 19:41:47 2014 +0200 writerfilter: remove unused getKind() Change-Id: I7d98d1fb400e1a73ca0d935d5cfbb82de43d795e diff --git a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx index 995dd55..d991a23 100644 --- a/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx +++ b/writerfilter/inc/resourcemodel/WW8ResourceModel.hxx @@ -348,7 +348,6 @@ public: SAL_WNODEPRECATED_DECLARATIONS_PUSH typedef std::auto_ptr Pointer_t; SAL_WNODEPRECATED_DECLARATIONS_POP -enum Kind { UNKNOWN, CHARACTER, PARAGRAPH, TABLE }; /** Returns id of the SPRM. @@ -377,11 +376,6 @@ public: virtual writerfilter::Reference::Pointer_t getProps() = 0; /** - Returns the kind of this SPRM. -*/ -virtual Kind getKind() = 0; - -/** Returns name of sprm. */ #ifdef DEBUG_DOMAINMAPPER diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index c718a52..4061de2 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -143,11 +143,6 @@ string OOXMLPropertyImpl::toString() const } #endif -Sprm::Kind OOXMLPropertyImpl::getKind() -{ -return SprmKind(getId()); -} - Sprm * OOXMLPropertyImpl::clone() { return new OOXMLPropertyImpl(*this); diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx index e9ca21a..96197b6 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.hxx @@ -78,9 +78,6 @@ public: virtual writerfilter::Reference::Pointer_t getProps() SAL_OVERRIDE; #ifdef DEBUG_DOMAINMAPPER virtual std::string getName() const SAL_OVERRIDE; -#endif -virtual Kind getKind() SAL_OVERRIDE; -#ifdef DEBUG_DOMAINMAPPER virtual std::string toString() const SAL_OVERRIDE; #endif virtual Sprm * clone() SAL_OVERRIDE; @@ -326,8 +323,6 @@ public: int getValue() const { return mnValue;} }; -Sprm::Kind SprmKind(sal_uInt32 nSprmCode); - } // namespace ooxml } // namespace writerfilter diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl index f1fb236..986312e 100644 --- a/writerfilter/source/ooxml/factoryimpl.xsl +++ b/writerfilter/source/ooxml/factoryimpl.xsl @@ -223,68 +223,6 @@ string fastTokenToId(sal_uInt32 nToken) - - - - - - - - case - - - - : // - - , - - - - - - - - -Sprm::Kind SprmKind(sal_uInt32 nSprmCode) -{ -Sprm::Kind nResult = Sprm::UNKNOWN; - -switch (nSprmCode) -{ - - paragraph - - - nResult = Sprm::PARAGRAPH; - break; - - character - - - nResult = Sprm::CHARACTER; - break; - - table - - - nResult = Sprm::TABLE; - break; - -default: - break; -} - -return nResult; -} - - uno::Reference < xml::sax::XFastParser > OOXMLStreamImpl::getFastParser() @@ -327,7 +265,6 @@ namespace ooxml { - /// @endcond diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index 53d4368..bf2b597 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -51,11 +51,6 @@ writerfilter::Reference::Pointer_t RTFSprm::getProps() return m_pValue->getProperties(); } -Sprm::Kind RTFSprm::getKind() -{ -return Sprm::UNKNOWN; -} - #ifdef DEBUG_DOMAINMAPPER std::string RTFSprm::getName() const { diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx index 576277c..b1142cf 100644 --- a/writerfilter/source/rtftok/rtfsprm.hxx +++ b/writerfilter/source/rtftok/rtfsprm.hxx @@ -110,7 +110,6 @@ public: virtual writerfilter::Reference::Pointer_t getBinary() SAL_OVERRIDE; virtual writerfilter::Reference::Pointer_t getStream() SAL_OVERRIDE; virtual writerfilter::Reference::Pointer_t getProps() SAL_OVERRIDE; -virtual Kind getKind() SAL_OVERRIDE; #ifdef DEBUG_DOMAINMAPPER virtual std::string getName() const SAL_OVERRIDE; virtual std::string toString() const SAL_OVERRIDE; ___ Libreoffice-commits mailing list libreof
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 11 +-- writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 ++- 2 files changed, 7 insertions(+), 7 deletions(-) New commits: commit 25b02fffbb6f68d0d60a1a421b9ae17dac00482d Author: Miklos Vajna Date: Mon Jul 7 11:44:52 2014 +0200 Use comphelper::SequenceAsVector Change-Id: I5458687f9a63b91c43c6ecce2cb4535e50e4a23e diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 021a626..7d71537 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4400,30 +4400,29 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) if (nParam >= 0) { m_aStates.top().aDrawingObject.nPolyLineCount = nParam; -m_aStates.top().aDrawingObject.aPolyLinePoints.realloc(nParam); } break; case RTF_DPPTX: { RTFDrawingObject& rDrawingObject = m_aStates.top().aDrawingObject; -if (!rDrawingObject.aPolyLinePoints.hasElements()) +if (rDrawingObject.aPolyLinePoints.empty()) dispatchValue(RTF_DPPOLYCOUNT, 2); - rDrawingObject.aPolyLinePoints[rDrawingObject.aPolyLinePoints.getLength() - rDrawingObject.nPolyLineCount].X = convertTwipToMm100(nParam); + rDrawingObject.aPolyLinePoints.push_back(awt::Point(convertTwipToMm100(nParam), 0)); } break; case RTF_DPPTY: { RTFDrawingObject& rDrawingObject = m_aStates.top().aDrawingObject; -if (rDrawingObject.aPolyLinePoints.hasElements()) +if (!rDrawingObject.aPolyLinePoints.empty()) { - rDrawingObject.aPolyLinePoints[rDrawingObject.aPolyLinePoints.getLength() - rDrawingObject.nPolyLineCount].Y = convertTwipToMm100(nParam); +rDrawingObject.aPolyLinePoints.back().Y = convertTwipToMm100(nParam); rDrawingObject.nPolyLineCount--; if (rDrawingObject.nPolyLineCount == 0) { uno::Sequence< uno::Sequence >aPointSequenceSequence(1); -aPointSequenceSequence[0] = rDrawingObject.aPolyLinePoints; +aPointSequenceSequence[0] = rDrawingObject.aPolyLinePoints.getAsConstList(); rDrawingObject.xPropertySet->setPropertyValue("PolyPolygon", uno::Any(aPointSequenceSequence)); } } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index d8e7134..eba6ef5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -153,7 +154,7 @@ public: sal_Int32 nDhgt; sal_Int32 nFLine; sal_Int32 nPolyLineCount; -css::uno::Sequence aPolyLinePoints; +comphelper::SequenceAsVector aPolyLinePoints; bool bHadShapeText; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/fdo73241.rtf |8 sw/qa/extras/rtfimport/rtfimport.cxx |6 ++ writerfilter/source/rtftok/rtfdocumentimpl.cxx |4 3 files changed, 18 insertions(+) New commits: commit e262086784defe1c0f417eedf52b5de2db8e559e Author: Miklos Vajna Date: Sat Jul 5 13:01:38 2014 +0200 fdo#73241 RTF import: ignore page break in tables (cherry picked from commit fdc235126d6d73f47a5b56d453e1d3db8ba3e816) Conflicts: sw/qa/extras/rtfimport/rtfimport.cxx Change-Id: Ibee9fec0f421b4c2ff3d45c861bc3fcfc97cbf15 Reviewed-on: https://gerrit.libreoffice.org/10092 Reviewed-by: Muthu Subramanian K Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/rtfimport/data/fdo73241.rtf b/sw/qa/extras/rtfimport/data/fdo73241.rtf new file mode 100644 index 000..b919e25 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo73241.rtf @@ -0,0 +1,8 @@ +{\rtf1 +\pard\plain Before.\par +\trowd \cellx4703\cellx9514\pard\plain\intbl +{\page First cell\cell Second cell\cell } +\pard\plain \intbl +{\trowd \cellx4703\cellx9514\row } +\pard\plain After.\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 4a5b844..4fd6941 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1703,6 +1703,12 @@ DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(getRun(getParagraph(1), 1), "CharFontName")); } +DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") +{ +// This was 2, page break in table wasn't ignored. +CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + 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 d05ac5b..cc627a5 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2273,6 +2273,10 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword) break; case RTF_PAGE: { +// Ignore page breaks inside tables. +if (m_aStates.top().pCurrentBuffer == &m_aTableBufferStack.back()) +break; + // If we're inside a continuous section, we should send a section break, not a page one. RTFValue::Pointer_t pBreak = m_aStates.top().aSectionSprms.find(NS_ooxml::LN_EG_SectPrContents_type); // Unless we're on a title page. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/ooxml/factoryimpl.xsl |1 - writerfilter/source/ooxml/model.xml | 20 2 files changed, 21 deletions(-) New commits: commit 30660c87f93903fe6ad17f49a355a0d27a2f123c Author: Miklos Vajna Date: Mon Jul 7 15:18:56 2014 +0200 writerfilter: unused resources-with-kind Change-Id: I8d42768a21b81831332a8bb6a1c4ae753238ae5b diff --git a/writerfilter/source/ooxml/factoryimpl.xsl b/writerfilter/source/ooxml/factoryimpl.xsl index 986312e..cea6198 100644 --- a/writerfilter/source/ooxml/factoryimpl.xsl +++ b/writerfilter/source/ooxml/factoryimpl.xsl @@ -51,7 +51,6 @@ - diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index f71b722..7eb4abc 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -23942,7 +23942,6 @@ margin - @@ -24297,14 +24296,12 @@ - - @@ -24327,7 +24324,6 @@ - @@ -24867,7 +24863,6 @@ http://schemas.microsoft.com/office/word/2010/wordml"; resource="Properties" tag="paragraph"> - @@ -25143,7 +25138,6 @@ - @@ -25156,7 +25150,6 @@ - @@ -25176,7 +25169,6 @@ - @@ -25211,7 +25203,6 @@ - @@ -25229,7 +25220,6 @@ - @@ -25265,7 +25255,6 @@ - @@ -25276,7 +25265,6 @@ - @@ -25294,7 +25282,6 @@ - @@ -25692,7 +25679,6 @@ - @@ -25718,12 +25704,10 @@ - - @@ -25734,19 +25718,16 @@ - - - @@ -25852,7 +25833,6 @@ - ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/source
sw/source/filter/ww8/ww8par.cxx | 14 +- sw/source/filter/ww8/ww8par.hxx |2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) New commits: commit d791e45741a7ff36c0942a600d2ee0c7fabcd06a Author: Miklos Vajna Date: Tue Feb 4 16:02:49 2014 +0100 DOC import: fix nested comments See 2.9.70 (FBKF) in the spec, the ibkl field should be used to find the position in PlcfBkf. Previously we assumed that PlcfBkl and PlcfBkf is parallel for annotations, as but that's not true for nested comments. Change-Id: I76a6a757b41d2f9b7fe7fe9c9e01a92c251f7b32 (cherry picked from commit 5cfda4f4de8da82485e27b1f0f0d94211d3b4d95) Reviewed-on: https://gerrit.libreoffice.org/10138 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index ed42bf4..0ba789b 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2162,7 +2162,7 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) if (nAtnIndex != -1) { WW8_CP nStart = GetAnnotationStart(nAtnIndex); -WW8_CP nEnd = GetAnnotationEnd(nAtnIndex); +WW8_CP nEnd = GetAnnotationEnd(GetAnnotationEndIndex(nAtnIndex)); sal_Int32 nLen = nEnd - nStart; if( nLen ) { @@ -5951,6 +5951,18 @@ int SwWW8ImplReader::GetAnnotationIndex(sal_uInt32 nTag) return -1; } +sal_uInt16 SwWW8ImplReader::GetAnnotationEndIndex(sal_uInt16 nStart) +{ +WW8_CP nStartAkt; +void* p; +if (mpAtnStarts->GetData(nStart, nStartAkt, p) && p) +{ +// p is an FBKF, and its first 2 bytes is the ibkl member, which is the end index. +return SVBT16ToShort(*((SVBT16*)p)); +} +return nStart; +} + WW8_CP SwWW8ImplReader::GetAnnotationStart(int nIndex) { if (!mpAtnStarts.get() && pWwFib->lcbPlcfAtnbkf) diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index 772da4c..9434c2e 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1635,6 +1635,8 @@ private: const OUString* GetAnnotationAuthor(sal_uInt16 nIdx); int GetAnnotationIndex(sal_uInt32 nTag); +/// Return the end index based on the start one. +sal_uInt16 GetAnnotationEndIndex(sal_uInt16 nStart); WW8_CP GetAnnotationStart(int nIndex); WW8_CP GetAnnotationEnd(int nIndex); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/2col-header.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |7 +++ sw/source/filter/ww8/wrtw8nds.cxx |7 ++- 3 files changed, 13 insertions(+), 1 deletion(-) New commits: commit c4a5f8c1afd42acb52d0ae9b4d6f42f3e87364d5 Author: Miklos Vajna Date: Tue Jul 8 14:41:10 2014 +0200 MSWordExportBase: fix export of header/footer in case of multiple columns Regression from 263938c4a8789d881f8e736d317b6bcc09c3bce5 (fdo#73596 [DOCX] Multiple Columns in Index, 2014-02-13), header / footer was lost in multi-column section. This fixes both DOC and DOCX export. Change-Id: Icb30ec882b38853e25289299d8f829a5cf56e6d8 diff --git a/sw/qa/extras/ooxmlexport/data/2col-header.docx b/sw/qa/extras/ooxmlexport/data/2col-header.docx new file mode 100644 index 000..3e8f2c4 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/2col-header.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index a1bf053..910fe13 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3745,6 +3745,13 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80898, "fdo80898.docx") "/word/embeddings/oleObject1.doc"); } +DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") +{ +// Header was lost on export when the document had multiple columns. +uno::Reference xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); +CPPUNIT_ASSERT_EQUAL(true, getProperty(xPageStyle, "HeaderIsOn")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 9f2af01..68e2799 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2733,10 +2733,15 @@ bool MSWordExportBase::NoPageBreakSection( const SfxItemSet* pSet ) const SfxPoolItem* pI; if( pSet) { -bool bNoPageBreak = true; +bool bNoPageBreak = false; if ( SFX_ITEM_ON != pSet->GetItemState(RES_PAGEDESC, true, &pI) || 0 == ((SwFmtPageDesc*)pI)->GetPageDesc() ) { +bNoPageBreak = true; +} + +if (bNoPageBreak) +{ if (SFX_ITEM_ON != pSet->GetItemState(RES_BREAK, true, &pI)) bNoPageBreak = true; else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/inc/swmodeltestbase.hxx| 13 + sw/qa/extras/ooxmlexport/ooxmlexport.cxx| 13 - sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 13 - sw/qa/extras/ooxmlexport/ooxmlw14export.cxx | 13 - 4 files changed, 13 insertions(+), 39 deletions(-) New commits: commit 4b9e9c804db355644527e4993e2fde9d608484ef Author: Miklos Vajna Date: Tue Jul 8 15:43:46 2014 +0200 sw: clean up DECLARE_OOXMLEXPORT_TEST copy&paste Change-Id: I2d702a3ea94412a35fee163581ef8c3f28566657 diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 6826472..8ede21a 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -78,6 +78,19 @@ using namespace css; CPPUNIT_TEST_SUITE_REGISTRATION(TestName); \ void TestName::verify() +#if 1 +#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) + +// For testing during development of a test, you want to use +// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 +// Of course, don't forget to set back to #if 1 when you are done :-) +#else +#define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) + +#undef DECLARE_OOXMLEXPORT_TEST +#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() +#endif + #define DECLARE_SW_IMPORT_TEST(TestName, filename, BaseClass) \ class TestName : public BaseClass { \ protected:\ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 910fe13..494b8a8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -74,19 +74,6 @@ protected: } }; -#if 1 -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -// For testing during development of a tast, you want to use -// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 -// Of course, don't forget to set back to #if 1 when you are done :-) -#else -#define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -#undef DECLARE_OOXMLEXPORT_TEST -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() -#endif - #if !defined(WNT) DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx") diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 0aa8235..f887d54 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -41,19 +41,6 @@ protected: } }; -#if 1 -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -// For testing during development of a tast, you want to use -// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 -// Of course, don't forget to set back to #if 1 when you are done :-) -#else -#define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -#undef DECLARE_OOXMLEXPORT_TEST -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() -#endif - DECLARE_OOXMLEXPORT_TEST(testDmlShapeTitle, "dml-shape-title.docx") { CPPUNIT_ASSERT_EQUAL(OUString("Title"), getProperty(getShape(1), "Title")); diff --git a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx index 84b6945..5354454 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlw14export.cxx @@ -26,19 +26,6 @@ protected: } }; -#if 1 -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -// For testing during development of a tast, you want to use -// DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 -// Of course, don't forget to set back to #if 1 when you are done :-) -#else -#define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) - -#undef DECLARE_OOXMLEXPORT_TEST -#define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() -#endif - DECLARE_OOXMLEXPORT_TEST(Test_TextEffects_GlowShadowReflection, "TextEffects_Glow_Shadow_Reflection.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: oox/source writerfilter/source
oox/source/token/namespaces-strict.txt |1 - oox/source/token/namespaces.txt|1 - writerfilter/source/ooxml/model.xml|1 - 3 files changed, 3 deletions(-) New commits: commit 9c451090df100e477272895c1c6d0ffd03a15812 Author: Miklos Vajna Date: Wed Jul 9 20:23:09 2014 +0200 remove no longer needed http://sprm nonsense Change-Id: I2f8d473ab564c9849963d937690fc48bc04a17b9 diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt index d49be5e..39a4fb5 100644 --- a/oox/source/token/namespaces-strict.txt +++ b/oox/source/token/namespaces-strict.txt @@ -68,7 +68,6 @@ ax http://schemas.microsoft.com/office/2006/activeX dc http://purl.org/dc/elements/1.1/ dcTerms http://purl.org/dc/terms/ xm http://schemas.microsoft.com/office/excel/2006/main -sprmhttp://sprm mce http://schemas.openxmlformats.org/markup-compatibility/2006 mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2 wps http://schemas.microsoft.com/office/word/2010/wordprocessingShape diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt index 63c0ce6..0cbae45 100644 --- a/oox/source/token/namespaces.txt +++ b/oox/source/token/namespaces.txt @@ -68,7 +68,6 @@ ax http://schemas.microsoft.com/office/2006/activeX dc http://purl.org/dc/elements/1.1/ dcTerms http://purl.org/dc/terms/ xm http://schemas.microsoft.com/office/excel/2006/main -sprmhttp://sprm mce http://schemas.openxmlformats.org/markup-compatibility/2006 mceTest http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2 wps http://schemas.microsoft.com/office/word/2010/wordprocessingShape diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index fb3e48b..9fab627 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -47,7 +47,6 @@ http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"; alias="wp14" id="wp14"/> http://schemas.microsoft.com/office/word/2010/wordml"; alias="w14" id="w14"/> http://schemas.microsoft.com/office/drawing/2010/main"; alias="a14" id="a14"/> - http://sprm"; alias="sprm" id="sprm"/> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/sdt-2-run.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 sw/source/filter/ww8/docxattributeoutput.cxx | 49 ++ sw/source/filter/ww8/docxattributeoutput.hxx |8 +++ writerfilter/source/dmapper/DomainMapper.cxx | 10 writerfilter/source/dmapper/DomainMapper_Impl.cxx | 10 writerfilter/source/dmapper/DomainMapper_Impl.hxx |6 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 9 files changed, 87 insertions(+), 8 deletions(-) New commits: commit 0a90643947e3767fd5d76784df54d7ee25e6793d Author: Miklos Vajna Date: Thu Jul 10 10:19:18 2014 +0200 DOCX export: allow multiple runs in w:sdt tags Change-Id: Iec053f92ebdfb89ddd311e190609c9dd1a1c64ef diff --git a/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx b/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx new file mode 100644 index 000..6063ebc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-2-run.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 494b8a8..d534ed9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3739,6 +3739,16 @@ DECLARE_OOXMLEXPORT_TEST(test2colHeader, "2col-header.docx") CPPUNIT_ASSERT_EQUAL(true, getProperty(xPageStyle, "HeaderIsOn")); } +DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-run.docx") +{ +xmlDocPtr pXmlDoc = parseExport(); +if (!pXmlDoc) +return; + +// The problem was that was closed after "first", not after "second", so the second assert failed. +assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[1]/w:t", "first"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", "second"); +} CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 937a337..85c45da 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -508,9 +508,16 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_nHyperLinkCount = 0; } +if (m_bStartedCharSdt) +{ +// Run-level SDT still open? Close it now. +EndSdtBlock(); +m_bStartedCharSdt = false; +} + m_pSerializer->endElementNS( XML_w, XML_p ); if( !m_bAnchorLinkedToNode ) -WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs ); +WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, /*bPara=*/true ); else { //These should be written out to the actual Node and not to the anchor. @@ -549,7 +556,10 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT } -void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ::sax_fastparser::FastAttributeList* &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs ) +void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, + ::sax_fastparser::FastAttributeList*& pSdtPrTokenChildren, + ::sax_fastparser::FastAttributeList*& pSdtPrDataBindingAttrs, + bool bPara ) { if( nSdtPrToken > 0 || pSdtPrDataBindingAttrs ) { @@ -597,8 +607,11 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ::sax_fastparse m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND ); // write the ending tags after the paragraph -m_pSerializer->endElementNS( XML_w, XML_sdtContent ); -m_pSerializer->endElementNS( XML_w, XML_sdt ); +if (bPara) +EndSdtBlock(); +else +// Support multiple runs inside a run-evel SDT: don't close the SDT block yet. +m_bStartedCharSdt = true; // clear sdt status nSdtPrToken = 0; @@ -611,6 +624,12 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ::sax_fastparse } } +void DocxAttributeOutput::EndSdtBlock() +{ +m_pSerializer->endElementNS( XML_w, XML_sdtContent ); +m_pSerializer->endElementNS( XML_w, XML_sdt ); +} + void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph ) { if ( pInner.get() ) @@ -945,6 +964,14 @@ void DocxAttributeOutput::EndRun() // before "postponed run start") m_pSerializer->mark(); // let'
[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/sdt-alias.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 11 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 25 - sw/source/filter/ww8/docxattributeoutput.hxx |7 ++- writerfilter/source/dmapper/DomainMapper.cxx | 12 +++- 5 files changed, 48 insertions(+), 7 deletions(-) New commits: commit 06e696a043114fcaba005cd8feac0ecb7ecede4a Author: Miklos Vajna Date: Thu Jul 10 11:48:06 2014 +0200 DOCX export: write inside Change-Id: Iaa020c00ddb3f9c6e6a9a6b2bc248a47c01a89d4 diff --git a/sw/qa/extras/ooxmlexport/data/sdt-alias.docx b/sw/qa/extras/ooxmlexport/data/sdt-alias.docx new file mode 100644 index 000..f46ef69 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-alias.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index d534ed9..d156805 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3749,6 +3749,17 @@ DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-run.docx") assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[1]/w:t", "first"); assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtContent/w:r[2]/w:t", "second"); } + +DECLARE_OOXMLEXPORT_TEST(testSdtAlias, "sdt-alias.docx") +{ +xmlDocPtr pXmlDoc = parseExport(); +if (!pXmlDoc) +return; + +// was completely missing. +assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:alias", "val", "Subtitle"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 85c45da..2026ddd 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -291,7 +291,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText m_bIsFirstParagraph = false; } -static void lcl_deleteAndResetTheLists( ::sax_fastparser::FastAttributeList* &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs) +static void lcl_deleteAndResetTheLists( ::sax_fastparser::FastAttributeList* &pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList* &pSdtPrDataBindingAttrs, OUString& rSdtPrAlias) { if( pSdtPrTokenChildren ) { @@ -303,6 +303,8 @@ static void lcl_deleteAndResetTheLists( ::sax_fastparser::FastAttributeList* &pS delete pSdtPrDataBindingAttrs; pSdtPrDataBindingAttrs = NULL; } +if (!rSdtPrAlias.isEmpty()) +rSdtPrAlias = ""; } void DocxAttributeOutput::PopulateFrameProperties(const SwFrmFmt* pFrmFmt, const Size& rSize) @@ -516,14 +518,15 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT } m_pSerializer->endElementNS( XML_w, XML_p ); +OUString aParagraphSdtPrAlias; if( !m_bAnchorLinkedToNode ) -WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, /*bPara=*/true ); +WriteSdtBlock( m_nParagraphSdtPrToken, m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, aParagraphSdtPrAlias, /*bPara=*/true ); else { //These should be written out to the actual Node and not to the anchor. //Clear them as they will be repopulated when the node is processed. m_nParagraphSdtPrToken = 0; -lcl_deleteAndResetTheLists( m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs ); +lcl_deleteAndResetTheLists( m_pParagraphSdtPrTokenChildren, m_pParagraphSdtPrDataBindingAttrs, aParagraphSdtPrAlias ); } //sdtcontent is written so Set m_bParagraphHasDrawing to false @@ -559,6 +562,7 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, ::sax_fastparser::FastAttributeList*& pSdtPrTokenChildren, ::sax_fastparser::FastAttributeList*& pSdtPrDataBindingAttrs, + OUString& rSdtPrAlias, bool bPara ) { if( nSdtPrToken > 0 || pSdtPrDataBindingAttrs ) @@ -598,6 +602,11 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, m_pSerializer->singleElementNS( XML_w, XML_dataBinding, xAttrList ); } +if (!rSdtPrAlias.isEmpty()) +m_pSerializer->singleElementNS(XML_w, XML_alias, FSNS(XML_w, XML_val), + OUStringToOString(rSdtPrAlias, RTL_TEXTENCODING_UTF8).getStr(), +
Re: [GSoC] Text Background Color in Draw - Report 22/06/2014
Hi Matteo, I noticed a crash that's probably related to your (otherwise great :-) ), text background editeng work -- care to take a look? 1) Start Writer, enable form controls toolbar (View -> Toolbars -> Form controls) 2) Click the more controls button, pick the Date Field 3) Draw a rectangle in the body text area to create an instance 4) Try to query its background color via UNO: Tools -> Macros -> Organize macros -> Basic -> Edit, then type: print ThisComponent.DrawPage(0).CharBackColor and Press F5 to run, it crashes with: Program received signal SIGSEGV, Segmentation fault. 0x73b4d9fc in SfxItemSet::Get (this=0x1dfaa00, nWhich=0, bSrchInParent=true) at /home/vmiklos/git/libreoffice/master/svl/source/items/itemset.cxx:1002 1002DBG_ASSERT( !pItem->ISA(SfxSetItem) || (gdb) bt 10 #0 0x73b4d9fc in SfxItemSet::Get (this=0x1dfaa00, nWhich=0, bSrchInParent=true) at /home/vmiklos/git/libreoffice/master/svl/source/items/itemset.cxx:1002 #1 0x7fffd2cc9de6 in SdrObject::GetMergedItem (this=0x226b140, nWhich=0) at /home/vmiklos/git/libreoffice/master/svx/source/svdraw/svdobj.cxx:2113 #2 0x7fffd2ea856e in SvxShape::_getPropertyValue (this=0x21c1f38, PropertyName="CharBackColor") at /home/vmiklos/git/libreoffice/master/svx/source/unodraw/unoshape.cxx:1797 nWhich = 0 sounds buggy, maybe you advertise your new UNO property in a generic property map, but in case of form controls, the underlying implementation doesn't handle that? Thanks, Miklos signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ww8export/ww8export.cxx |3 --- sw/qa/extras/ww8import/ww8import.cxx |4 2 files changed, 7 deletions(-) New commits: commit 2292f0026284b69ad3351e7a45dfc36fc41dd1a2 Author: Miklos Vajna Date: Thu Jul 10 15:26:52 2014 +0200 CppunitTest_sw_ww8{im,ex}port: enable on Windows Change-Id: I503e737b00c033ff6186805724e57d445c0ab674 diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 397d760..61655ee 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -8,8 +8,6 @@ #include -#if !defined(WNT) - #include #include #include @@ -345,7 +343,6 @@ DECLARE_WW8EXPORT_TEST(testBorderColoursExport, "bordercolours.odt") CPPUNIT_ASSERT_BORDER_EQUAL(expectedBottom, border); #endif } -#endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index ce23780..15d10d2 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -8,8 +8,6 @@ #include -#if !defined(WNT) - #include #include #include @@ -462,8 +460,6 @@ DECLARE_WW8IMPORT_TEST(testFdo77844, "fdo77844.doc") #endif } -#endif - CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/table-btlr-center.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |9 +++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 17 +++ writerfilter/source/dmapper/DomainMapperTableManager.cxx |7 ++ writerfilter/source/dmapper/PropertyIds.cxx |1 writerfilter/source/dmapper/PropertyIds.hxx |1 6 files changed, 35 insertions(+) New commits: commit c65aa400296a1a1b59b43223bdac030c749e51e3 Author: Miklos Vajna Date: Wed Jul 2 17:33:03 2014 +0200 bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr (cherry picked from commit 3325e0f206ce864730468c3556ce06760042c157) Reviewed-on: https://gerrit.libreoffice.org/10049 Reviewed-by: Andras Timar Tested-by: Andras Timar Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d Reviewed-on: https://gerrit.libreoffice.org/10046 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx new file mode 100644 index 000..79cb53e Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/table-btlr-center.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index b55c64d..a0c09c9 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2193,6 +2193,15 @@ DECLARE_OOXMLIMPORT_TEST(testFdo80555, "fdo80555.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(245), xShape->getPosition().Y); } +DECLARE_OOXMLIMPORT_TEST(testTableBtlrCenter, "table-btlr-center.docx") +{ +uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); +uno::Reference xTable(xTables->getByIndex(0), uno::UNO_QUERY); +// Cell vertical alignment was NONE, should be CENTER. +CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xTable->getCellByName("A2"), "VertOrient")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 57bbd32..a8650a5 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -826,6 +828,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } aCellIterator->get()->erase(PROP_HORIZONTAL_MERGE); } + +// Cell direction is not an UNO Property, either. +const PropertyMap::const_iterator aCellDirectionIter = aCellIterator->get()->find(PROP_CELL_DIRECTION); +if (aCellDirectionIter != aCellIterator->get()->end()) +{ +if (aCellDirectionIter->second.getValue().get() == 3) +{ +// btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. +uno::Reference xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); +if (xPropertySet->getPropertyValue("ParaAdjust").get() == style::ParagraphAdjust_CENTER) +aCellIterator->get()->Insert(PROP_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER)); +} +aCellIterator->get()->erase(PROP_CELL_DIRECTION); +} + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); #ifdef DEBUG_DMAPPER_TABLE_HANDLER dmapper_logger->endElement(); diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx index 98fa11a..8eaeccc 100644 --- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx @@ -330,6 +330,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TcPrBase_textDirection: { TablePropertyMapPtr pPropMap( new TablePropertyMap ); + +// Remember the cell direction, so later in +// DomainMapperTableHandler::endTableGetCellProperties() can we +// handle the combination of the cell direction and paragraph +// alignment as necessary. +pPropMap->Insert(PROP_CELL_DIRECTION, uno::Any(sal_Int32(3))); + bool bInsertCellProps = true; switch ( nInt
[Libreoffice-commits] core.git: 4 commits - sw/qa sw/source writerfilter/source
sw/qa/extras/README| 48 ++--- sw/qa/extras/ooxmlexport/data/sdt-date-charformat.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |9 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 10 +++ sw/source/filter/ww8/docxtablestyleexport.cxx |5 + sw/source/filter/ww8/docxtablestyleexport.hxx |7 ++ writerfilter/source/dmapper/DomainMapper.cxx |6 +- writerfilter/source/dmapper/SdtHelper.cxx |5 + writerfilter/source/dmapper/SdtHelper.hxx |2 9 files changed, 58 insertions(+), 34 deletions(-) New commits: commit 3bd2fa9111ac95044240d4fb80fb4f4c1426bb06 Author: Miklos Vajna Date: Thu Jul 10 17:52:30 2014 +0200 Update sw/qa/extras/README The run() method is gone since 4.2. Change-Id: Ia7a9932001dff7834e960885096468148d47738a diff --git a/sw/qa/extras/README b/sw/qa/extras/README index 01e0976..fbc6aac 100644 --- a/sw/qa/extras/README +++ b/sw/qa/extras/README @@ -5,9 +5,9 @@ tests. This file documents how to add new testcases to this framework. == Import tests -Import tests are the easier ones. First you need to add a new entry to the -table inside the `run()` method, so the framework will load the specified file -to `mxComponent`, which represents the UNO model of the document. +Import tests are the easier ones. First you need to use +`DECLARE_SW_IMPORT_TEST()`, so the framework will load the specified file to +`mxComponent`, which represents the UNO model of the document. The rest of the testcase is about implementing the test method asserting this document model: use the UNO API to retrieve properties, then use @@ -26,6 +26,9 @@ at the `layout.xml` file in the current directory. Once you find the needed information in that file, you can write your XPath expression to turn that into a testcase. +(Similarly, Shift-F12 produces a `nodes.xml` for the document model dump, but +it's unlikely that you'll need that in a unit test.) + == Export tests Export tests are similar. Given that test documents are easier to provide in @@ -34,14 +37,13 @@ most cases, we will do an import, then do an export (to invoke the code we want to test) and then do an import again, so we can do the testing by asserting the document model, just like we did for import tests. -Yes, this means that you can test the export code (using this framework) if the -importer is working correctly. (But that's not so bad, users usually expect a -feature to work in both the importer and the exporter.) +Yes, this means that you can only test the export code (using this framework) +if the importer is working correctly. (But that's not so bad, users usually +expect a feature to work in both the importer and the exporter.) The only difference is that in these tests the test method is called twice: once after the initial import -- so you can see if the export fails due to an -import problem in fact -- and once after the export and import. The test -method should still assert the document model only, as discussed above. +import problem in fact -- and once after the export and import. === Direct XPath assertions @@ -49,14 +51,12 @@ An other alternative is to assert the resulted export document directly. Currently this is only implemented for DOCX, which is a zipped XML, so it's possible to evaluate XPath checks. A check looks like this: -xmlDocPtr pXmlDoc = parseExport("word/document.xml"); -if (!pXmlDoc) -return; -assertXPath(pXmlDoc, , , ); +if (xmlDocPtr pXmlDoc = parseExport("word/document.xml")) +assertXPath(pXmlDoc, , , ); It's important to check for the NULL pointer here, it's expected that it'll be NULL when the test runs first (after the first import), as there is nothing -exported yet. +exported yet. For other XPath assert variants, see the `XmlTestTools` class. == Helper methods @@ -115,7 +115,7 @@ develop quickly. With some experimenting, you'll end up with something like this: -oStyle = ThisComponent.StyleFamilies.PageStyles.Default +oStyle = ThisComponent.StyleFamilies.PageStyles.getByName("Default Style") xray oStyle.IsLandscape @@ -124,14 +124,8 @@ when later this test fails for some reason. In cpp, you typically need to be more verbose, so the code will look like: -uno::Reference xStyleFamiliesSupplier(mxComponent, uno::UNO_QUERY); -uno::Reference xStyles(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY); -uno::Reference xPageStyles(xStyles->getByName("PageStyles"), uno::UNO_QUERY); -uno::Reference xStyle(xPageStyles->getByName(DEFAULT_STYLE), uno::UNO_QUERY); - -sal_Bool bIsLandscape = sal_False; -xStyle->getPropertyValue("IsLandscape") >>= bIsLandscape; -CPPUNIT_ASSERT_EQUAL(sal_True, bIsLandscape); +uno::Reference xStyle(getStyles("
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/bnc884615.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx |6 ++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- writerfilter/source/dmapper/OLEHandler.cxx | 10 -- writerfilter/source/dmapper/OLEHandler.hxx |4 +++- 5 files changed, 18 insertions(+), 4 deletions(-) New commits: commit 5360af296a67d40d9172a877a674f454eed8fa98 Author: Miklos Vajna Date: Fri Jul 4 16:38:40 2014 +0200 bnc#884615 VML import: import OLE objects in header with background wrapping We already do this for drawingML shapes since commit 500343105707a9905f5198a4af6ad58fe307b7c2 (DOCX drawingML shape import: always set Opaque, 2013-12-04), make the VML / OLE case behave the same as well. (cherry picked from commit 15c3a08b8b1e8060f9659c7bc98480a39d1802c5) Conflicts: sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx Change-Id: Ic22f1f3cfd325ccbbb9bd6fe9814553683e4de55 Reviewed-on: https://gerrit.libreoffice.org/10088 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/ooxmlexport/data/bnc884615.docx b/sw/qa/extras/ooxmlexport/data/bnc884615.docx new file mode 100755 index 000..51ee5ca Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/bnc884615.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index f3ebd43..142d087 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -1513,6 +1513,12 @@ DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height); } +DECLARE_OOXMLEXPORT_TEST(testBnc884615, "bnc884615.docx") +{ +// The problem was that the shape in the header wasn't in the background. +CPPUNIT_ASSERT_EQUAL(false, bool(getProperty(getShape(1), "Opaque"))); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 98286c3..b854738 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2211,7 +2211,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { -OLEHandlerPtr pOLEHandler( new OLEHandler ); +OLEHandlerPtr pOLEHandler( new OLEHandler(*this) ); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index 1976a13..a07b443 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #include +#include #include #include "GraphicHelpers.hxx" @@ -45,11 +46,12 @@ namespace dmapper { using namespace ::com::sun::star; -OLEHandler::OLEHandler() : +OLEHandler::OLEHandler(DomainMapper& rDomainMapper) : LoggedProperties(dmapper_logger, "OLEHandler"), m_nDxaOrig(0), m_nDyaOrig(0), -m_nWrapMode(1) +m_nWrapMode(1), +m_rDomainMapper(rDomainMapper) { } @@ -104,6 +106,10 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal) try { +// Shapes in the header or footer should be in the background. +if (m_rDomainMapper.IsInHeaderFooter()) +xShapeProps->setPropertyValue("Opaque", uno::makeAny(false)); + m_aShapeSize = xTempShape->getSize(); m_aShapePosition = xTempShape->getPosition(); diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index 00b4d8a..9e22fc1 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -40,6 +40,7 @@ namespace com{ namespace sun{ namespace star{ namespace writerfilter { namespace dmapper { +class DomainMapper; /** Handler for OLE objects */ class OLEHandler : public LoggedProperties @@ -63,6 +64,7 @@ class OLEHandler : public LoggedProperties ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > m_xReplacement; ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xInputStream; +DomainMapper& m_rDomainMapper; // Properties virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE; @@ -73,7 +75,7 @@ class OLEHandler : public LoggedProperties const OUString& sObjectName ); public: -OLEHandler(); +OLEHandler(
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/TblStylePrHandler.cxx |9 ++--- writerfilter/source/dmapper/TblStylePrHandler.hxx |3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) New commits: commit daf354fa7f2cf800a0661813ddf8d7c49c5c5f59 Author: Miklos Vajna Date: Fri Jul 11 18:54:00 2014 +0200 Use comphelper::SequenceAsVector Change-Id: I0d1e22344a2aa1474d022364b12cd34d7d56c2d8 diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx index ffd8dd6..24fee7d 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.cxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx @@ -103,7 +103,7 @@ void TblStylePrHandler::lcl_sprm(Sprm & rSprm) case NS_ooxml::LN_CT_TrPrBase: case NS_ooxml::LN_CT_TcPrBase: { -std::vector aSavedGrabBag; +comphelper::SequenceAsVector aSavedGrabBag; bool bGrabBag = rSprm.getId() == NS_ooxml::LN_CT_PPrBase || rSprm.getId() == NS_ooxml::LN_EG_RPrBase || rSprm.getId() == NS_ooxml::LN_CT_TblPrBase || @@ -173,12 +173,7 @@ beans::PropertyValue TblStylePrHandler::getInteropGrabBag(const OUString& aName) beans::PropertyValue aRet; aRet.Name = aName; -uno::Sequence aSeq(m_aInteropGrabBag.size()); -beans::PropertyValue* pSeq = aSeq.getArray(); -for (std::vector::iterator i = m_aInteropGrabBag.begin(); i != m_aInteropGrabBag.end(); ++i) -*pSeq++ = *i; - -aRet.Value = uno::makeAny(aSeq); +aRet.Value = uno::makeAny(m_aInteropGrabBag.getAsConstList()); return aRet; } diff --git a/writerfilter/source/dmapper/TblStylePrHandler.hxx b/writerfilter/source/dmapper/TblStylePrHandler.hxx index cb13b26..3191efa 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.hxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.hxx @@ -25,6 +25,7 @@ #include #include #include +#include namespace writerfilter { namespace dmapper { @@ -57,7 +58,7 @@ private: TblStyleTypem_nType; PropertyMapPtr m_pProperties; -std::vector m_aInteropGrabBag; +comphelper::SequenceAsVector m_aInteropGrabBag; // Properties virtual void lcl_attribute(Id Name, Value & val) SAL_OVERRIDE; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source
writerfilter/CustomTarget_source.mk|6 writerfilter/source/ooxml/factoryimpl.py | 204 + writerfilter/source/ooxml/factoryimpl.xsl | 274 - writerfilter/source/ooxml/factorytools.xsl | 20 -- 4 files changed, 207 insertions(+), 297 deletions(-) New commits: commit a7706f8a4e79fd36a296e988f7f852dfd549a16f Author: Miklos Vajna Date: Sat Jul 12 10:09:53 2014 +0200 writerfilter: convert factoryimpl to Python Change-Id: I2065215db5da0a379e902a74eff419d5c6068d21 diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index 989a623..9fdaf00 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -79,9 +79,9 @@ writerfilter_SRC_ooxml_Preprocess_py=$(writerfilter_SRC)/ooxml/modelpreprocess.p writerfilter_SRC_ooxml_QNameToStr_py=$(writerfilter_SRC)/ooxml/qnametostr.py writerfilter_SRC_ooxml_ResourceIds_py=$(writerfilter_SRC)/ooxml/resourceids.py -$(writerfilter_GEN_ooxml_Factory_cxx) : $(writerfilter_SRC)/ooxml/factoryimpl.xsl $(writerfilter_GEN_ooxml_Model_processed) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ +$(writerfilter_GEN_ooxml_Factory_cxx) : $(writerfilter_SRC)/ooxml/factoryimpl.py $(writerfilter_GEN_ooxml_Model_processed) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) + $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ $(writerfilter_GEN_ooxml_Factory_hxx) : $(writerfilter_SRC)/ooxml/factoryinc.py $(writerfilter_GEN_ooxml_Model_processed) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) diff --git a/writerfilter/source/ooxml/factoryimpl.py b/writerfilter/source/ooxml/factoryimpl.py new file mode 100644 index 000..0fb9144 --- /dev/null +++ b/writerfilter/source/ooxml/factoryimpl.py @@ -0,0 +1,204 @@ +#!/usr/bin/env python +# +# 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/. +# + +from __future__ import print_function +from xml.dom import minidom +import sys + + +def getElementsByTagNamesNS(parent, ns, names, ret=minidom.NodeList()): +for node in parent.childNodes: +if node.nodeType == minidom.Node.ELEMENT_NODE and node.namespaceURI == ns and node.tagName in names: +ret.append(node) +getElementsByTagNamesNS(node, ns, names, ret) +return ret + + +def createFastChildContextFromFactory(model): +print("""uno::Reference OOXMLFactory::createFastChildContextFromFactory +(OOXMLFastContextHandler* pHandler, OOXMLFactory_ns::Pointer_t pFactory, Token_t Element) +{ +uno::Reference aResult; +Id nDefine = pHandler->getDefine(); + +if (pFactory.get() != NULL) +{ +CreateElementMapPointer pMap = pFactory->getCreateElementMap(nDefine); +TokenToIdMapPointer pTokenMap = pFactory->getTokenToIdMap(nDefine); + +if (pMap.get() != NULL) +{ +Id nId = (*pTokenMap)[Element]; +CreateElement aCreateElement = (*pMap)[Element]; + +switch (aCreateElement.m_nResource) +{""") +resources = ["List", "Integer", "Hex", "String", "UniversalMeasure", "Boolean"] +for resource in [r.getAttribute("resource") for r in model.getElementsByTagName("resource")]: +if resource not in resources: +resources.append(resource) +print("""case RT_%s: + aResult.set(OOXMLFastHelper::createAndSetParentAndDefine(pHandler, Element, nId, aCreateElement.m_nId)); +break;""" % (resource, resource)) +print("""case RT_Any: +aResult.set(createFastChildContextFromStart(pHandler, Element)); +break; +default: +break; +} + +} +} + +return aResult; +} +""") + + +def getFactoryForNamespace(model): +print("""OOXMLFactory_ns::Pointer_t OOXMLFactory::getFactoryForNamespace(Id nId) +{ +OOXMLFactory_ns::Pointer_t pResult; + +switch (nId & 0x) +{""") + +for namespace in [ns.getAttribute("name") for ns in model.getElementsByTagName("namespace")]: +id = namespace.replace('-', '_') +print("""case NN_%s: +pResult = OOXMLFactory_%s::getInstance(); +break;""" % (id, i
[Libreoffice-commits] core.git: sw/inc sw/source
sw/inc/viewsh.hxx |1 + sw/source/core/draw/dflyobj.cxx |4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) New commits: commit fb0b42b89af95b42cc6caadf8c22321e5c9386e8 Author: Miklos Vajna Date: Sat Jul 12 11:09:06 2014 +0200 CppunitTest_tiledrendering: disable SwVirtFlyDrawObj assert for now Change-Id: I289632e4e686b56d83855a0a5c69744b3b7e035e diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 14b7982..a0b9613 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -571,6 +571,7 @@ public: bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; } virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; } bool IsSelectAll() { return mbSelectAll; } +bool IsTiledRendering() { return mbTiledRendering; } }; // manages global ShellPointer diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index bc043ed..c8177a9 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -469,7 +469,9 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject( // if there's no viewport set, all fly-frames will be painted, // which is slow, wastes memory, and can cause other trouble. (void) rViewInformation; // suppress "unused parameter" warning -assert(!rViewInformation.getViewport().isEmpty()); +if (!pShell->IsTiledRendering()) +// FIXME is it OK to have no viewport during tiled rendering? +assert(!rViewInformation.getViewport().isEmpty()); if ( !pFlyFrm->IsFlyInCntFrm() ) { // it is also necessary to restore the VCL MapMode from ViewInformation since e.g. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/rtfimport/data/fdo80905.rtf | 12 sw/qa/extras/rtfimport/rtfimport.cxx | 10 ++ sw/source/core/unocore/unofield.cxx |4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) New commits: commit d0a7a60cfa1a34ec7218656489b7463cd9eb1aad Author: Miklos Vajna Date: Sun Jul 13 18:02:29 2014 +0200 fdo#80905 SwXTextFieldMasters::hasByName(): sync with SwXFieldMaster Normally a mail merge field has a name like "css.text.fieldmaster.DataBase...", however this isn't enforced: just "css.text.fieldmaster.DataBase.TEST" is also accepted (even if its semantics are ~undefined). If SwXFieldMaster::setPropertyValue() allows setting such a field master name, then SwXTextFieldMasters::hasByName() should not ignore such field masters that have no dot in their name ("TEST") or use "Database", not "DataBase", otherwise (sane) client code in writerfilter ends up with hasByName() returning false, but setPropertyValue() throwing an exception, because the field master does have such a name. This fixes DOCX/RTF import of multiple mail merge fields with the same field command. Change-Id: I498eabace25f8e466b3504ba13fa3060d4ba22da diff --git a/sw/qa/extras/rtfimport/data/fdo80905.rtf b/sw/qa/extras/rtfimport/data/fdo80905.rtf new file mode 100644 index 000..c088fe0 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo80905.rtf @@ -0,0 +1,12 @@ +{\rtf1 +\pard\plain +{\field +{\*\fldinst MERGEFIELD TEST \\* Upper \\* MERGEFORMAT} +{\fldrslt \'abTEST\'bb} +} +{\field +{\*\fldinst MERGEFIELD TEST \\* Upper \\* MERGEFORMAT} +{\fldrslt \'abTEST\'bb} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 0adabdc..76de5bb 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1774,6 +1774,16 @@ DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") CPPUNIT_ASSERT_EQUAL(1, getPages()); } +DECLARE_RTFIMPORT_TEST(testFdo80905, "fdo80905.rtf") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); +uno::Reference xFields(xFieldsAccess->createEnumeration()); +xFields->nextElement(); +// The problem was that there was only one field in the document, but there should be true. +CPPUNIT_ASSERT_EQUAL(true, static_cast(xFields->hasMoreElements())); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index a05c41f..b524ecc 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2673,11 +2673,11 @@ static sal_uInt16 lcl_GetIdByName( OUString& rName, OUString& rTypeName ) if( sUIName != sFldTypName ) rName = comphelper::string::setToken(rName, 1, '.', sUIName); } -else if (rTypeName == "DataBase") +else if (rTypeName.equalsIgnoreAsciiCase("DataBase")) { rName = rName.copy(RTL_CONSTASCII_LENGTH("DataBase.")); const sal_Int32 nDotCount = comphelper::string::getTokenCount(rName, '.'); -if( 2 <= nDotCount ) +if( 1 <= nDotCount ) { // #i51815# rName = "DataBase." + rName; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: [Libreoffice-qa] Whiteboard Consistency
On Mon, Jul 14, 2014 at 01:58:56AM +0400, Jay Philips wrote: > I have been using ww8 to cover all the doc/xls/etc. as i saw Stahl use > it in one of his comments. I saw Joren using odf, so i've been using > that sometimes. I dont see much benefit in breaking odf down into > individual odf extensions as we can already limit queries by application. WW8 is just "WinWord 8", i.e. what Microsoft calls [MS-DOC], using ww8 to refer to xls/ppt is misleading. Maybe just use the extension for all the cases? That's easy to understand for everyone, unlike WW8, OOXML, ODF, and others. BTW, Joel: I have no problem with whiteboard renames, though if you could please: 1) Send a mail to this list when you did rename them and 2) Do it with a script, so for the casual developer the rename is more or less atomic That would be excellent and make our lives much easier. :-) signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [GSoC] Text Background Color in Draw - Report 22/06/2014
On Fri, Jul 11, 2014 at 04:20:26PM +0200, Matteo Campanelli wrote: > This patch is for fixing the crash and generate an "inadmissible data type" > dialog. I think that's a clear improvement, please push to master. Having a crash while inspecting a form control is as annoying as gdb crashing during LO debugging. :-) signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa sw/source
sw/qa/extras/rtfimport/data/fdo80905.rtf | 12 sw/qa/extras/rtfimport/rtfimport.cxx | 10 ++ sw/source/core/unocore/unofield.cxx |4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) New commits: commit a4fd1b2eafcc49486cb6a360d792f779659b68e2 Author: Miklos Vajna Date: Sun Jul 13 18:02:29 2014 +0200 fdo#80905 SwXTextFieldMasters::hasByName(): sync with SwXFieldMaster Normally a mail merge field has a name like "css.text.fieldmaster.DataBase...", however this isn't enforced: just "css.text.fieldmaster.DataBase.TEST" is also accepted (even if its semantics are ~undefined). If SwXFieldMaster::setPropertyValue() allows setting such a field master name, then SwXTextFieldMasters::hasByName() should not ignore such field masters that have no dot in their name ("TEST") or use "Database", not "DataBase", otherwise (sane) client code in writerfilter ends up with hasByName() returning false, but setPropertyValue() throwing an exception, because the field master does have such a name. This fixes DOCX/RTF import of multiple mail merge fields with the same field command. (cherry picked from commit d0a7a60cfa1a34ec7218656489b7463cd9eb1aad) Conflicts: sw/source/core/unocore/unofield.cxx Change-Id: I498eabace25f8e466b3504ba13fa3060d4ba22da Reviewed-on: https://gerrit.libreoffice.org/10269 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/rtfimport/data/fdo80905.rtf b/sw/qa/extras/rtfimport/data/fdo80905.rtf new file mode 100644 index 000..c088fe0 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo80905.rtf @@ -0,0 +1,12 @@ +{\rtf1 +\pard\plain +{\field +{\*\fldinst MERGEFIELD TEST \\* Upper \\* MERGEFORMAT} +{\fldrslt \'abTEST\'bb} +} +{\field +{\*\fldinst MERGEFIELD TEST \\* Upper \\* MERGEFORMAT} +{\fldrslt \'abTEST\'bb} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 4fd6941..6f6dede 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1709,6 +1709,16 @@ DECLARE_RTFIMPORT_TEST(testFdo73241, "fdo73241.rtf") CPPUNIT_ASSERT_EQUAL(1, getPages()); } +DECLARE_RTFIMPORT_TEST(testFdo80905, "fdo80905.rtf") +{ +uno::Reference xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xFieldsAccess(xTextFieldsSupplier->getTextFields()); +uno::Reference xFields(xFieldsAccess->createEnumeration()); +xFields->nextElement(); +// The problem was that there was only one field in the document, but there should be true. +CPPUNIT_ASSERT_EQUAL(true, static_cast(xFields->hasMoreElements())); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 3043353..56be0c0 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2674,11 +2674,11 @@ static sal_uInt16 lcl_GetIdByName( OUString& rName, OUString& rTypeName ) if( sUIName != sFldTypName ) rName = comphelper::string::setToken(rName, 1, '.', sUIName); } -else if (rTypeName == "DataBase") +else if (rTypeName.equalsIgnoreAsciiCase("DataBase")) { rName = rName.copy(RTL_CONSTASCII_LENGTH("DataBase.")); sal_uInt16 nDotCount = comphelper::string::getTokenCount(rName, '.'); -if( 2 <= nDotCount ) +if( 1 <= nDotCount ) { // #i51815# rName = "DataBase." + rName; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/footer-body-distance.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx|7 ++ writerfilter/source/dmapper/PropertyMap.cxx | 53 +++- 3 files changed, 31 insertions(+), 29 deletions(-) New commits: commit f3145f74a2829526169a44696dbd3c16b2c5ae77 Author: Miklos Vajna Date: Mon Jul 14 15:38:51 2014 +0200 Clean up SectionPropertyMap::PrepareHeaderFooterProperties() If you copy the class members on the stack and tweak those (and not class members), then there is no need to manually restore the copy at the end of the method. Change-Id: I42b50cd6b99b6b277dd9809b40385ef6512ef141 diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index eb83a35..ff76c13 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -791,32 +791,32 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage ) sal_Int32 nHeaderTop = m_nHeaderTop; if(HasHeader(bFirstPage)) { -m_nTopMargin = m_nHeaderTop; -if( nTopMargin > 0 && nTopMargin > m_nHeaderTop ) -m_nHeaderTop = nTopMargin - m_nHeaderTop; +nTopMargin = nHeaderTop; +if( m_nTopMargin > 0 && m_nTopMargin > nHeaderTop ) +nHeaderTop = m_nTopMargin - nHeaderTop; else -m_nHeaderTop = 0; +nHeaderTop = 0; //minimum header height 1mm -if( m_nHeaderTop < MIN_HEAD_FOOT_HEIGHT ) -m_nHeaderTop = MIN_HEAD_FOOT_HEIGHT; +if( nHeaderTop < MIN_HEAD_FOOT_HEIGHT ) +nHeaderTop = MIN_HEAD_FOOT_HEIGHT; } -if( nTopMargin >= 0 ) //fixed height header -> see WW8Par6.hxx +if( m_nTopMargin >= 0 ) //fixed height header -> see WW8Par6.hxx { operator[](PROP_HEADER_IS_DYNAMIC_HEIGHT) = uno::makeAny( true ); operator[](PROP_HEADER_DYNAMIC_SPACING) = uno::makeAny( true ); -operator[](PROP_HEADER_BODY_DISTANCE) = uno::makeAny( m_nHeaderTop - MIN_HEAD_FOOT_HEIGHT );// ULSpace.Top() -operator[](PROP_HEADER_HEIGHT) = uno::makeAny( m_nHeaderTop ); +operator[](PROP_HEADER_BODY_DISTANCE) = uno::makeAny( nHeaderTop - MIN_HEAD_FOOT_HEIGHT );// ULSpace.Top() +operator[](PROP_HEADER_HEIGHT) = uno::makeAny( nHeaderTop ); } else { //todo: old filter fakes a frame into the header/footer to support overlapping //current setting is completely wrong! -operator[](PROP_HEADER_HEIGHT) = uno::makeAny( m_nHeaderTop ); -operator[](PROP_HEADER_BODY_DISTANCE) = uno::makeAny( nTopMargin - m_nHeaderTop ); +operator[](PROP_HEADER_HEIGHT) = uno::makeAny( nHeaderTop ); +operator[](PROP_HEADER_BODY_DISTANCE) = uno::makeAny( m_nTopMargin - nHeaderTop ); operator[](PROP_HEADER_IS_DYNAMIC_HEIGHT) = uno::makeAny( false ); operator[](PROP_HEADER_DYNAMIC_SPACING) = uno::makeAny( false ); } @@ -825,21 +825,21 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage ) sal_Int32 nHeaderBottom = m_nHeaderBottom; if( HasFooter( bFirstPage ) ) { -m_nBottomMargin = m_nHeaderBottom; -if( nBottomMargin > 0 && nBottomMargin > m_nHeaderBottom ) -m_nHeaderBottom = nBottomMargin - m_nHeaderBottom; +nBottomMargin = nHeaderBottom; +if( m_nBottomMargin > 0 && m_nBottomMargin > nHeaderBottom ) +nHeaderBottom = m_nBottomMargin - nHeaderBottom; else -m_nHeaderBottom = 0; -if( m_nHeaderBottom < MIN_HEAD_FOOT_HEIGHT ) -m_nHeaderBottom = MIN_HEAD_FOOT_HEIGHT; +nHeaderBottom = 0; +if( nHeaderBottom < MIN_HEAD_FOOT_HEIGHT ) +nHeaderBottom = MIN_HEAD_FOOT_HEIGHT; } -if( nBottomMargin >= 0 ) //fixed height footer -> see WW8Par6.hxx +if( m_nBottomMargin >= 0 ) //fixed height footer -> see WW8Par6.hxx { operator[](PROP_FOOTER_IS_DYNAMIC_HEIGHT) = uno::makeAny( true ); operator[](PROP_FOOTER_DYNAMIC_SPACING) = uno::makeAny( true ); -operator[](PROP_FOOTER_BODY_DISTANCE) = uno::makeAny( m_nHeaderBottom - MIN_HEAD_FOOT_HEIGHT); -operator[](PROP_FOOTER_HEIGHT) = uno::makeAny( m_nHeaderBottom ); +operator[](PROP_FOOTER_BODY_DISTANCE) = uno::makeAny( nHeaderBottom - MIN_HEAD_FOOT_HEIGHT); +operator[](PROP_FOOTER_HEIGHT) = uno::makeAny( nHeaderBottom ); } else { @@ -847,19 +847,13 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage ) //current setting is completely wrong! operator[](PROP_FOOTER_IS_DYNAMIC_HEIGHT) = uno::makeAny( false ); operator[](PROP_FOOTER_DYNAMIC_SPACING) = uno::makeAny( false ); -operator[](PROP_FOOTER_HEIGHT) = uno
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/ooxmlimport.cxx |2 - writerfilter/source/dmapper/DomainMapper_Impl.cxx | 28 +- writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 + 3 files changed, 30 insertions(+), 2 deletions(-) New commits: commit fc3eb493ac9e8dec35060524db4dc8ca3210631a Author: Miklos Vajna Date: Tue Jul 15 18:18:19 2014 +0200 Related: bnc#875718 DOCX import: fix missing character grab-bag on fields The problem was that in case: 1) The paragraph only had a single text portion, which was a field and char grab-bag was set on it and 2) The paragraph had a style which also set the character grab-bag then during import the field's gra-bag was set on the paragraph (as it's the only portion) and later the paragraph style overwrote this, in case that had a grab-bag, too. Work this around by ensuring that in case of portion fields (i.e. not ToC, which has its own paragraphs), there are always at least two portions in a paragraph (the second is removed later). This also fixes the fake paragraph problem at the end of the bnc#875718 testcase. (There was an empty paragraph at the end of the document, but not in the file itself.) Change-Id: Ie404bc043d46157ea6157b18c4a46395cf496118 diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 8d85f1d..efbfebb 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2190,7 +2190,7 @@ DECLARE_OOXMLIMPORT_TEST(testBnc875718, "bnc875718.docx") // Also check that the footer contents are not in the body text. uno::Reference textDocument(mxComponent, uno::UNO_QUERY); uno::Reference text(textDocument->getText(), uno::UNO_QUERY); -CPPUNIT_ASSERT_EQUAL( OUString( "Text\n" ), text->getString()); +CPPUNIT_ASSERT_EQUAL( OUString( "Text" ), text->getString()); } DECLARE_OOXMLIMPORT_TEST(testCaption, "caption.docx") diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index e74383e..6645e23 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -208,7 +208,8 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIgnoreNextTab(false), m_bFrameBtLr(false), m_bIsSplitPara(false), -m_vTextFramesForChaining() +m_vTextFramesForChaining(), +m_bParaHadField(false) { appendTableManager( ); @@ -1112,7 +1113,27 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) rAppendContext.pLastParagraphProperties->SetEndingRange(xTextRange->getEnd()); } else +{ +uno::Reference xCursor; +if (m_bParaHadField) +{ +// Workaround to make sure char props of the field are not lost. +OUString sMarker("X"); +xCursor = xTextAppend->getText()->createTextCursor(); +if (xCursor.is()) +xCursor->gotoEnd(false); +PropertyMapPtr pEmpty(new PropertyMap()); +appendTextPortion("X", pEmpty); +} + xTextRange = xTextAppend->finishParagraph( aProperties ); + +if (xCursor.is()) +{ +xCursor->goLeft(1, true); +xCursor->setString(OUString()); +} +} getTableManager( ).handle(xTextRange); // Get the end of paragraph character inserted @@ -1153,6 +1174,7 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap ) } SetIsOutsideAParagraph(true); +m_bParaHadField = false; #ifdef DEBUG_DOMAINMAPPER dmapper_logger->endElement(); #endif @@ -2426,6 +2448,7 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::FindOrCreateFieldMaster ---*/ void DomainMapper_Impl::PushFieldContext() { +m_bParaHadField = true; if(m_bDiscardHeaderFooter) return; #ifdef DEBUG_DOMAINMAPPER @@ -3134,6 +3157,7 @@ void DomainMapper_Impl::handleToc } } pContext->SetTOC( xTOC ); +m_bParaHadField = false; OUString sMarker("Y"); //insert index @@ -3171,6 +3195,7 @@ void DomainMapper_Impl::handleBibliography xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(OUString())); pContext->SetTOC( xTOC ); +m_bParaHadField = false; uno::Reference< text::XTextContent > x
[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source
writerfilter/CustomTarget_source.mk|6 - writerfilter/source/ooxml/factory_ns.py| 83 writerfilter/source/ooxml/factory_ns.xsl | 150 - writerfilter/source/ooxml/factorytools.xsl | 11 -- 4 files changed, 86 insertions(+), 164 deletions(-) New commits: commit 3f2d6c7f7a6ef825b9431a3d270bc75b84069a32 Author: Miklos Vajna Date: Tue Jul 15 21:13:01 2014 +0200 writerfilter: convert factory_ns to Python Change-Id: I64996b3f96f51ba80ade636c13a2919410672a27 diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index 9fdaf00..b84e235 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -125,9 +125,9 @@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : $(writerfilter_SRC)/ooxml/factory $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) --stringparam file $@ $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ -$(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : $(writerfilter_SRC)/ooxml/factory_ns.xsl $(writerfilter_GEN_ooxml_Model_processed) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) --stringparam file $@ $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ +$(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : $(writerfilter_SRC)/ooxml/factory_ns.py $(writerfilter_GEN_ooxml_Model_processed) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) + $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed) $@) > $@ $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL) diff --git a/writerfilter/source/ooxml/factory_ns.py b/writerfilter/source/ooxml/factory_ns.py new file mode 100644 index 000..edd0718 --- /dev/null +++ b/writerfilter/source/ooxml/factory_ns.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# +# 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/. +# + +from __future__ import print_function +from xml.dom import minidom +import sys + + +def createHeader(model, ns): +nsToken = ns.replace('-', '_') +print(""" +#ifndef INCLUDED_OOXML_FACTORY_%s_HXX +#define INCLUDED_OOXML_FACTORY_%s_HXX +#include "ooxml/OOXMLFactory.hxx" +#include "OOXMLFactory_generated.hxx" +#include "ooxml/OOXMLnamespaceids.hxx" +#include "ooxml/resourceids.hxx" + +namespace writerfilter { +namespace ooxml { + +/// @cond GENERATED +""" % (nsToken.upper(), nsToken.upper())) + +print("""class OOXMLFactory_%s : public OOXMLFactory_ns +{ +public: +typedef boost::shared_ptr Pointer_t; + +static Pointer_t getInstance(); + +virtual AttributeToResourceMapPointer createAttributeToResourceMap(Id nId); +virtual ListValueMapPointer createListValueMap(Id nId); +virtual CreateElementMapPointer createCreateElementMap(Id nId); +virtual TokenToIdMapPointer createTokenToIdMap(Id nId); +#ifdef DEBUG_DOMAINMAPPER +virtual string getDefineName(Id nId) const; +#endif +""" % nsToken) + +actions = [] +for nsNode in [i for i in model.getElementsByTagName("namespace") if i.getAttribute("name") == ns]: +for resource in nsNode.getElementsByTagName("resource"): +for action in [i.getAttribute("name") for i in resource.childNodes if i.nodeType == minidom.Node.ELEMENT_NODE and i.tagName == "action"]: +if action != "characters" and action not in actions: +actions.append(action) +for action in actions: +print("void %sAction(OOXMLFastContextHandler* pHandler);" % action) + +print("""virtual void charactersAction(OOXMLFastContextHandler* pHandler, const OUString & sText); +virtual void attributeAction(OOXMLFastContextHandler* pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue); + +#ifdef DEBUG_DOMAINMAPPER +virtual string getName() const; +#endif + + +virtual ~OOXMLFactory_%s(); + +protected: +static Pointer_t m_pInstance; + +OOXMLFactory_%s(); +}; +""" % (nsToken, nsToken)) + +print("""/// @endcond +}} +#endif //INCLUDED_OOXML_FACTORY_%s_HXX""" % nsToken.upper()) + +modelPath = sys.argv[1] +filePath = sys.argv[2] +model = minidom.parse(modelPath) +ns = filePath.split('OOXMLFactory_')[1].split('.hxx')[0] +createHeader(model, ns) + +# vim:set shiftwidth=4 softtabstop=4 expa
[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source
sw/qa/core/data/rtf/pass/abi2720.rtf | 259 + writerfilter/source/rtftok/rtfdocumentimpl.cxx |8 2 files changed, 264 insertions(+), 3 deletions(-) New commits: commit 326460072a42d849b46ab88b48580825bdb0bcc7 Author: Miklos Vajna Date: Thu Jun 19 17:49:29 2014 +0200 abi#2720 RTF import: handle non-graphic object after a graphic one Change-Id: I9416b6e7cf3677006215fcbde458ed341c4e3e9e (cherry picked from commit 3cab1adf19d553663685e8198f0ec3f258a37c36) Signed-off-by: Michael Stahl diff --git a/sw/qa/core/data/rtf/pass/abi2720.rtf b/sw/qa/core/data/rtf/pass/abi2720.rtf new file mode 100644 index 000..a337bda --- /dev/null +++ b/sw/qa/core/data/rtf/pass/abi2720.rtf @@ -0,0 +1,259 @@ +{\rtf1 +\pard\plain \widctlpar\adjustright +\fs20\lang1031\cgrid +{\lang1024 +{\shpgrp +{\*\shpinst\shpleft0\shptop0\shpright14175\shpbottom9071\shpfhdr0\shpbxcolumn\shpbypara\shpwr3\shpwrk0\shpfblwtxt0\shpz1\shplid1032 +{\sp +{\sn groupLeft} +{\sv 1418} +} +{\sp +{\sn groupTop} +{\sv 1418} +} +{\sp +{\sn groupRight} +{\sv 15593} +} +{\sp +{\sn groupBottom} +{\sv 10489} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn lidRegroup} +{\sv 0} +} +{\shp +{\*\shpinst\shplid1037 +{\sp +{\sn relLeft} +{\sv 2856} +} +{\sp +{\sn relTop} +{\sv 4008} +} +{\sp +{\sn relRight} +{\sv 3216} +} +{\sp +{\sn relBottom} +{\sv 4176} +} +{\sp +{\sn fRelFlipH} +{\sv 0} +} +{\sp +{\sn fRelFlipV} +{\sv 0} +} +{\sp +{\sn shapeType} +{\sv 0} +} +{\sp +{\sn geoRight} +{\sv 360} +} +{\sp +{\sn geoBottom} +{\sv 168} +} +{\sp +{\sn shapePath} +{\sv 4} +} +{\sp +{\sn pVerticies} +{\sv 8;10;(168,168);(84,108);(0,48);(24,24);(48,0);(264,0);(312,24);(360,48);(336,108);(312,168)} +} +{\sp +{\sn pSegmentInfo} +{\sv 2;9;16384;44288;8193 +;44288;8193;44288;8193;44032;32768} +} +{\sp +{\sn fFillOK} +{\sv 1} +} +{\sp +{\sn fFilled} +{\sv 0} +} +{\sp +{\sn lineEndArrowhead} +{\sv 2} +} +{\sp +{\sn lineEndArrowWidth} +{\sv 1} +} +{\sp +{\sn lineEndArrowLength} +{\sv 0} +} +{\sp +{\sn fArrowheadsOK} +{\sv 1} +} +{\sp +{\sn lidRegroup} +{\sv 0} +} +} +} +} +{\shprslt +{\*\do\dobxcolumn\dobypara\dodhgt8193\dppolygon\dppolycount4\dpptx0\dppty0\dpptx14175\dppty0\dpptx14175\dppty9071\dpptx0\dppty9071\dpx0\dpy0\dpxsize14175\dpysize9071 +\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr255\dpfillbgcg255\dpfillbgcb255\dpfillpat1\dplinew15\dplinecor0\dplinecog0\dplinecob0} +} +} +} +{\page } +{\lang1024 +{\shpgrp +{\*\shpinst\shpleft0\shptop0\shpright14175\shpbottom9071\shpfhdr0\shpbxcolumn\shpbypara\shpwr3\shpwrk0\shpfblwtxt0\shpz2\shplid1038 +{\sp +{\sn groupLeft} +{\sv 1418} +} +{\sp +{\sn groupTop} +{\sv 1418} +} +{\sp +{\sn groupRight} +{\sv 15593} +} +{\sp +{\sn groupBottom} +{\sv 10489} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn lidRegroup} +{\sv 0} +} +{\shp +{\*\shpinst\shplid1041 +{\sp +{\sn relLeft} +{\sv 8506} +} +{\sp +{\sn relTop} +{\sv 5954} +} +{\sp +{\sn relRight} +{\sv 15593} +} +{\sp +{\sn relBottom} +{\sv 10489} +} +{\sp +{\sn fRelFlipH} +{\sv 0} +} +{\sp +{\sn fRelFlipV} +{\sv 0} +} +{\sp +{\sn shapeType} +{\sv 202} +} +{\sp +{\sn lTxid} +{\sv 458752} +} +{\sp +{\sn hspNext} +{\sv 1041} +} +{\sp +{\sn fFitShapeToText} +{\sv 0} +} +{\shptxt \pard\plain +\pard\plain \widctlpar\adjustright \f1\fs20\lang1031\cgrid +{\f1\dn28 +{\pict +{\*\picprop\shplid1025 +{\sp +{\sn shapeType} +{\sv 75} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn pictureActive} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 268435473} +} +{\sp +{\sn fFilled} +{\sv 0} +} +{\sp +{\sn fLine} +{\sv 0} +} +} +\picscalex100\picscaley100\piccropl0\piccropr0\piccropt0\piccropb0\picw1870\pich1199\picwgoal1060\pichgoal680\wmetafile8\bliptag-1230064263\blipupi-1583 +{\*\blipuid b6aeb57956b0ad18d349a83cd13b7dd7} +010009037001020015000500090204000201010005000102ff000500090204002e011800 +05003102010005000b0205000c024004a0060e0026060f0012000800c0ffbaff6006fa030b002606 +0f000c004d61746854797065e50009021500fb0280fe90010102001054696d6573204e657720526f6d61 +6e0004002d010900320a800234000100430001010900320a8002de0401004100ea001500fb0220ff9001 +0102001054696d6573204e657720526f6d616e2304002d0101000400f0010900320ad401d805010069003e000900 +320af5031503010069003e000900320aee00040301006e0070001000fb0280fe900100020002001053796d626f6c0002 +04002d010400f00101000900320a8002a40101003d00d3001000fb0220ff900100020002001053796d626f6c +000204002d0101000400f0010900320af5036a0301003d007b000900320aee00830301002d007b001000fb02c0fd
[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 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 copy&pasted 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::Reference xStyle(getStyles("PageStyles")->getByName(DE CPPUNIT_ASSERT_EQUAL(true, getProperty(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 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:docume
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf |7 +++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- 2 files changed, 8 insertions(+), 1 deletion(-) New commits: commit 50df6263ccde24874191812950dcccd8f839754b Author: Miklos Vajna Date: Mon Feb 17 17:50:57 2014 +0100 fdo#81173 abi#3623 RTF import: missing null pointer check (cherry picked from commit 08fb25ab7941c52d4eed0435a45a38b03aff588c) Signed-off-by: Michael Stahl Change-Id: I5861e5fec0d822f42dfeb994500a818a968e69fb diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf new file mode 100644 index 000..a47161a --- /dev/null +++ b/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf @@ -0,0 +1,7 @@ +{\rtf1 +{\stylesheet +{\s2\ls1\sbasedon0 heading 2;} +} +\s2 +foo\par +} diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ff8428f..b9b1adf 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3261,7 +3261,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType { const StyleSheetEntryPtr pParent = pStyleTable->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier); const StyleSheetPropertyMap* pParentProperties = dynamic_cast(pParent ? pParent->pProperties.get() : 0); -if (pParentProperties->find(PROP_PARA_RIGHT_MARGIN) != pParentProperties->end()) +if (pParentProperties && pParentProperties->find(PROP_PARA_RIGHT_MARGIN) != pParentProperties->end()) nParaRightMargin = pParentProperties->find(PROP_PARA_RIGHT_MARGIN)->second.getValue().get(); } if (nParaRightMargin != 0) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/plausable-border.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx|8 ++ sw/source/filter/ww8/writerwordglue.cxx | 23 +--- 3 files changed, 28 insertions(+), 3 deletions(-) New commits: commit 385852e9add39081f8e915bd88ad8560630762a2 Author: Miklos Vajna Date: Wed Jul 16 16:48:35 2014 +0200 sw::util::IsPlausableSingleWordSection: take care of Boxes if LRSpace differs The problem was the following: due to borders, the LR space items were not equal, but we still want to merge the page styles, as they only differ due to the page border. Change-Id: I55069368edba27ab9c70421e5e71ca24c73350e9 diff --git a/sw/qa/extras/ooxmlexport/data/plausable-border.docx b/sw/qa/extras/ooxmlexport/data/plausable-border.docx new file mode 100644 index 000..a1a9547 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/plausable-border.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 0e69a54..a5aa50d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3810,6 +3810,14 @@ DECLARE_OOXMLEXPORT_TEST(testSdtCitationRun, "sdt-citation-run.docx") } } +DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") +{ +// sw::util::IsPlausableSingleWordSection() did not merge two page styles due to borders. +if (xmlDocPtr pXmlDoc = parseExport()) +// Page break was exported as section break, this was 0 +assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index ddc8313..f6b1f0d 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -334,6 +334,23 @@ namespace myImplHelpers }; } +/// Count what Word calls left/right margin from a format's LRSpace + Box. +static SvxLRSpaceItem lcl_getWordLRSpace(const SwFrmFmt& rFmt) +{ +SvxLRSpaceItem aLR(rFmt.GetLRSpace()); +const SvxBoxItem& rBox = rFmt.GetBox(); + +aLR.SetLeft(aLR.GetLeft() + rBox.GetDistance(BOX_LINE_LEFT)); +if (const editeng::SvxBorderLine* pLeft = rBox.GetLeft()) +aLR.SetLeft(aLR.GetLeft() + pLeft->GetWidth()); + +aLR.SetRight(aLR.GetRight() + rBox.GetDistance(BOX_LINE_RIGHT)); +if (const editeng::SvxBorderLine* pRight = rBox.GetRight()) +aLR.SetRight(aLR.GetRight() + pRight->GetWidth()); + +return aLR; +} + namespace sw { namespace util @@ -347,8 +364,8 @@ namespace sw const SwFmtCol& rFollowCols = rFollowFmt.GetCol(); const SwColumns& rFirstColumns = rFirstCols.GetColumns(); const SwColumns& rFollowColumns = rFollowCols.GetColumns(); -const SvxLRSpaceItem &rOneLR = rTitleFmt.GetLRSpace(); -const SvxLRSpaceItem &rTwoLR= rFollowFmt.GetLRSpace(); +SvxLRSpaceItem aOneLR = lcl_getWordLRSpace(rTitleFmt); +SvxLRSpaceItem aTwoLR = lcl_getWordLRSpace(rFollowFmt); const SwFmtFrmSize& rFirstFrmSize = rTitleFmt.GetFrmSize(); const SwFmtFrmSize& rFollowFrmSize = rFollowFmt.GetFrmSize(); @@ -357,7 +374,7 @@ namespace sw //e.g. #i4320# bPlausableSingleWordSection = false; } -else if (rOneLR != rTwoLR) +else if (aOneLR != aTwoLR) bPlausableSingleWordSection = false; else if (rFirstFrmSize != rFollowFrmSize) bPlausableSingleWordSection = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: solenv/gbuild
solenv/gbuild/CppunitTest.mk |1 + 1 file changed, 1 insertion(+) New commits: commit a3b6e0da35987af441042bd444c331d78a7c69b5 Author: Miklos Vajna Date: Wed Jul 16 21:02:32 2014 +0200 gbuild: set VCL_HIDE_WINDOWS for non-headless CppunitTests This avoids the flashing window even on Linux, while making such tests headless would make them fail. Change-Id: I7cf8d410e257574f0177ca8b7e6465a5efd62280 diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 622e16d..df5c61b 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -81,6 +81,7 @@ $(call gb_CppunitTest_get_target,%) :| $(gb_CppunitTest_CPPTESTDEPS) ($(gb_CppunitTest_CPPTESTPRECOMMAND) \ $(if $(G_SLICE),G_SLICE=$(G_SLICE)) \ $(if $(GLIBCXX_FORCE_NEW),GLIBCXX_FORCE_NEW=$(GLIBCXX_FORCE_NEW)) \ + $(if $(HEADLESS),,VCL_HIDE_WINDOWS=1) \ $(ICECREAM_RUN) $(gb_CppunitTest_GDBTRACE) $(gb_CppunitTest_VALGRINDTOOL) $(gb_CppunitTest_CPPTESTCOMMAND) \ $(call gb_LinkTarget_get_target,$(call gb_CppunitTest_get_linktarget,$*)) \ $(call gb_CppunitTest__make_args) \ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/rtftok/rtfdocumentimpl.cxx |3 +-- writerfilter/source/rtftok/rtfdocumentimpl.hxx |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) New commits: commit 14898bc3853c52c53c14b5af779e81a9d3e5485a Author: Miklos Vajna Date: Wed Jul 16 22:02:56 2014 +0200 writerfilter: identation fixes At least the ones detected by astyle, as requested at <https://gerrit.libreoffice.org/10351>. Change-Id: If87d847f260b4e7ed71115bd8cc1af55cd349b02 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 14bc7fd..8d54a69 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -695,8 +695,7 @@ void RTFDocumentImpl::resolve(Stream& rMapper) } } -int RTFDocumentImpl::resolvePict(bool const bInline, -uno::Reference const& i_xShape) +int RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference const& i_xShape) { SvMemoryStream aStream; SvStream* pStream = 0; diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index e07f09a..39a6654 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -363,8 +363,7 @@ public: bool isInBackground(); void setDestinationText(OUString& rString); /// Resolve a picture: If not inline, then anchored. -int resolvePict(bool bInline, -css::uno::Reference const& xShape); +int resolvePict(bool bInline, css::uno::Reference const& xShape); /// If this is the first run of the document, starts the initial paragraph. void checkFirstRun(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source
sw/qa/extras/ooxmlexport/ooxmlexport.cxx| 11 --- sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 11 +++ sw/source/filter/ww8/docxsdrexport.cxx | 20 +++- sw/source/filter/ww8/docxsdrexport.hxx |2 -- 4 files changed, 22 insertions(+), 22 deletions(-) New commits: commit 461e46904ffa29820be1ccb64cdb9cb6d4469b6c Author: Miklos Vajna Date: Thu Jul 17 09:48:18 2014 +0200 DocxSdrExport: move member to impl class Change-Id: I37aef651cf6424e7935ea3584b8f493f6f24c484 diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 363b5b9..da9dc23 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -164,6 +164,8 @@ struct DocxSdrExport::Impl bool m_bDMLAndVMLDrawingOpen; /// List of TextBoxes in this document: they are exported as part of their shape, never alone. std::set m_aTextBoxes; +/// Preserved rotation for TextFrames. +sal_Int32 m_nDMLandVMLTextFrameRotation; Impl(DocxSdrExport& rSdrExport, DocxExport& rExport, sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML) : m_rSdrExport(rSdrExport), @@ -186,7 +188,8 @@ struct DocxSdrExport::Impl m_nId(0), m_nSeq(0), m_bDMLAndVMLDrawingOpen(false), - m_aTextBoxes(SwTextBoxHelper::findTextBoxes(m_rExport.pDoc)) + m_aTextBoxes(SwTextBoxHelper::findTextBoxes(m_rExport.pDoc)), + m_nDMLandVMLTextFrameRotation(0) { } @@ -203,8 +206,7 @@ struct DocxSdrExport::Impl }; DocxSdrExport::DocxSdrExport(DocxExport& rExport, sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML) -: m_pImpl(new Impl(*this, rExport, pSerializer, pDrawingML)), - DMLandVMLTextFrameRotation(0) +: m_pImpl(new Impl(*this, rExport, pSerializer, pDrawingML)) { } @@ -1273,7 +1275,7 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo FSEND); uno::Any aRotation ; -DMLandVMLTextFrameRotation = 0; +m_pImpl->m_nDMLandVMLTextFrameRotation = 0; if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("FrameInteropGrabBag")) { uno::Sequence< beans::PropertyValue > propList; @@ -1288,11 +1290,11 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo } } } -aRotation >>= DMLandVMLTextFrameRotation ; -OString sRotation(OString::number((OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(DMLandVMLTextFrameRotation; +aRotation >>= m_pImpl->m_nDMLandVMLTextFrameRotation ; +OString sRotation(OString::number((OOX_DRAWINGML_EXPORT_ROTATE_CLOCKWISIFY(m_pImpl->m_nDMLandVMLTextFrameRotation; // Shape properties pFS->startElementNS(XML_wps, XML_spPr, FSEND); -if (DMLandVMLTextFrameRotation) +if (m_pImpl->m_nDMLandVMLTextFrameRotation) { pFS->startElementNS(XML_a, XML_xfrm, XML_rot, sRotation.getStr(), @@ -1466,9 +1468,9 @@ void DocxSdrExport::writeVMLTextFrame(sw::Frame* pParentFrame, bool bTextBoxOnly m_pImpl->m_pFlyAttrList = pFS->createAttrList(); m_pImpl->m_pTextboxAttrList = pFS->createAttrList(); m_pImpl->m_aTextFrameStyle = "position:absolute"; -if(!bTextBoxOnly) +if (!bTextBoxOnly) { -OString sRotation(OString::number(DMLandVMLTextFrameRotation / -100)); +OString sRotation(OString::number(m_pImpl->m_nDMLandVMLTextFrameRotation / -100)); m_pImpl->m_rExport.SdrExporter().getTextFrameStyle().append(";rotation:").append(sRotation); } m_pImpl->m_rExport.OutputFormat(pParentFrame->GetFrmFmt(), false, false, true); diff --git a/sw/source/filter/ww8/docxsdrexport.hxx b/sw/source/filter/ww8/docxsdrexport.hxx index 1b8954d..5c98a42 100644 --- a/sw/source/filter/ww8/docxsdrexport.hxx +++ b/sw/source/filter/ww8/docxsdrexport.hxx @@ -101,8 +101,6 @@ public: bool isTextBox(const SwFrmFmt& rFrmFmt); /// Writes text from Textbox for void writeOnlyTextOfFrame(sw::Frame* pParentFrame); - -sal_Int32 DMLandVMLTextFrameRotation; }; #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXSDREXPORT_HXX commit c9227b26683ae960a79d60725caf70ac2515a4d0 Author: Miklos Vajna Date: Thu Jul 17 09:44:35 2014 +0200 sw: move testcase to the right suite Change-Id: Ieb89836facb28ef1432b48810532f6f0b4b00a89 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index afc8242..a5aa50d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3741,17 +3741,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-6' - writerfilter/qa writerfilter/source
writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf |7 +++ writerfilter/source/dmapper/DomainMapper.cxx |2 +- 2 files changed, 8 insertions(+), 1 deletion(-) New commits: commit b0dae2115364ae1644203c046765f10ccfe9a8ac Author: Miklos Vajna Date: Mon Feb 17 17:50:57 2014 +0100 fdo#81173 abi#3623 RTF import: missing null pointer check (cherry picked from commit 08fb25ab7941c52d4eed0435a45a38b03aff588c) Signed-off-by: Michael Stahl Change-Id: I5861e5fec0d822f42dfeb994500a818a968e69fb (cherry picked from commit 50df6263ccde24874191812950dcccd8f839754b) Reviewed-on: https://gerrit.libreoffice.org/10358 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara Reviewed-by: Andras Timar diff --git a/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf b/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf new file mode 100644 index 000..a47161a --- /dev/null +++ b/writerfilter/qa/cppunittests/rtftok/data/pass/abi3623.rtf @@ -0,0 +1,7 @@ +{\rtf1 +{\stylesheet +{\s2\ls1\sbasedon0 heading 2;} +} +\s2 +foo\par +} diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index ff8428f..b9b1adf 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -3261,7 +3261,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType { const StyleSheetEntryPtr pParent = pStyleTable->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier); const StyleSheetPropertyMap* pParentProperties = dynamic_cast(pParent ? pParent->pProperties.get() : 0); -if (pParentProperties->find(PROP_PARA_RIGHT_MARGIN) != pParentProperties->end()) +if (pParentProperties && pParentProperties->find(PROP_PARA_RIGHT_MARGIN) != pParentProperties->end()) nParaRightMargin = pParentProperties->find(PROP_PARA_RIGHT_MARGIN)->second.getValue().get(); } if (nParaRightMargin != 0) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sw/inc sw/qa writerfilter/inc writerfilter/source
sw/inc/fmtclbl.hxx|1 + sw/qa/extras/inc/swmodeltestbase.hxx |3 +++ sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 -- writerfilter/inc/dmapper/DomainMapper.hxx |1 + writerfilter/inc/resourcemodel/WW8ResourceModel.hxx |3 +++ writerfilter/source/dmapper/DomainMapper.cxx |5 + writerfilter/source/dmapper/DomainMapper_Impl.cxx |6 ++ writerfilter/source/dmapper/DomainMapper_Impl.hxx |3 +++ writerfilter/source/dmapper/PropertyMap.cxx |9 ++--- writerfilter/source/dmapper/PropertyMap.hxx |2 +- writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |5 + writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |1 + writerfilter/source/ooxml/model.xml |1 + 14 files changed, 44 insertions(+), 6 deletions(-) New commits: commit 5f7bba13a7bd35f3861f9c6ed75e7b1c539c7367 Author: Miklos Vajna Date: Thu Jul 17 15:17:08 2014 +0200 CppunitTest_sw_ooxmlimport: allow running a single test Change-Id: I494cc676f384edbac9f64c1bc02b14cf7973d0d8 diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index 8ede21a..43e6d7e 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -79,15 +79,18 @@ using namespace css; void TestName::verify() #if 1 +#define DECLARE_OOXMLIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test) #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) // For testing during development of a test, you want to use // DECLARE_OOXMLEXPORT_TEST_ONLY, and change the above to #if 0 // Of course, don't forget to set back to #if 1 when you are done :-) #else +#define DECLARE_OOXMLIMPORT_TEST_ONLY(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test) #define DECLARE_OOXMLEXPORT_TEST_ONLY(TestName, filename) DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, Test) #undef DECLARE_OOXMLEXPORT_TEST +#define DECLARE_OOXMLIMPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() #define DECLARE_OOXMLEXPORT_TEST(TestName, filename) class disabled##TestName : public Test { void disabled(); }; void disabled##TestName::disabled() #endif diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 4f63183..9de6c29 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -83,8 +83,6 @@ public: } }; -#define DECLARE_OOXMLIMPORT_TEST(TestName, filename) DECLARE_SW_IMPORT_TEST(TestName, filename, Test) - DECLARE_OOXMLIMPORT_TEST(testN751054, "n751054.docx") { text::TextContentAnchorType eValue = getProperty(getShape(1), "AnchorType"); commit d185204737031955c56a24356ed003d342548434 Author: Miklos Vajna Date: Thu Jul 17 14:59:19 2014 +0200 DOCX import: set DontBalanceTextColumns=true for the last section ... ... if it has multiple columns. See wwSectionManager::InsertSegments() for the related binary import code which already did this. Change-Id: I919f585bd864db748cd349e01789ec7805f031a1 diff --git a/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx new file mode 100755 index 000..da6f93f Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index efbfebb..4f63183 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2276,6 +2276,14 @@ DECLARE_OOXMLIMPORT_TEST(testFdo76803, "fdo76803.docx") CPPUNIT_ASSERT_EQUAL(double(0), aPolygon.getB2DPoint(3).getY()); } +DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx") +{ +uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); +// This was false, last section was balanced, but it's unbalanced in Word. +CPPUNIT_ASSERT_EQUAL(true, getProperty(xTextSections->getByIndex(2), "DontBalanceTextColumns")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index 9266f08..7143219 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -87,6 +87,7 @@ public: // Stream virtual void markLastParagraphInSection() SAL_OVERRIDE; +virtual void markLastSectionGroup() SAL_OVERRIDE; // BinaryObj
[Libreoffice-commits] core.git: sw/Module_sw.mk sw/qa
sw/Module_sw.mk |1 sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 441 -- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 517 ++ 3 files changed, 518 insertions(+), 441 deletions(-) New commits: commit 6ff22ec2a61a17c2c75da6f6ff84476922392dbb Author: Miklos Vajna Date: Thu Jul 17 15:53:26 2014 +0200 extract CppunitTest_sw_ooxmlfieldexport from CppunitTest_sw_ooxmlimport before: $ time make -sr CppunitTest_sw_ooxmlexport real4m5.728s after: $ time make -sr CppunitTest_sw_ooxmlexport real3m24.446s and the new CppunitTest_sw_ooxmlfieldexport can run in parallel. Change-Id: I5a1d121f51e2d09a1c2126a33484e956c5c706a8 diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 7e71e2c..27ca49f 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -55,6 +55,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_htmlexport \ CppunitTest_sw_macros_test \ CppunitTest_sw_ooxmlexport \ +CppunitTest_sw_ooxmlfieldexport \ CppunitTest_sw_ooxmlsdrexport \ CppunitTest_sw_ooxmlw14export \ CppunitTest_sw_ooxmlimport \ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index a5aa50d..eb81a06 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -377,18 +377,6 @@ DECLARE_OOXMLEXPORT_TEST(testTablePosition, "table-position.docx") } } -DECLARE_OOXMLEXPORT_TEST(testFdo47669, "fdo47669.docx") -{ -/* - * Problem: we created imbalance which shouldn't be there, - * resulting in loading error: missing last character of hyperlink text - * and content after it wasn't loaded. - */ -getParagraph(1, "This is a hyperlink with anchor. Also, this sentence should be seen."); -getRun(getParagraph(1), 2, "hyperlink with anchor"); -CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/#a";), getProperty(getRun(getParagraph(1), 2), "HyperLinkURL")); -} - struct SingleLineBorders { sal_Int16 top, bottom, left, right; SingleLineBorders(int t=0, int b=0, int l=0, int r=0) @@ -466,24 +454,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo51550, "fdo51550.odt") CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); } -DECLARE_OOXMLEXPORT_TEST(testN789482, "n789482.docx") -{ -// The problem was that w:del was exported before w:hyperlink, resulting in an invalid XML. -uno::Reference xParagraph = getParagraph(1); -getRun(xParagraph, 1, "Before. "); - -CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty(getRun(xParagraph, 2), "RedlineType")); -CPPUNIT_ASSERT_EQUAL(sal_True, getProperty(getRun(xParagraph, 2), "IsStart")); - -getRun(xParagraph, 3, "www.test.com"); -CPPUNIT_ASSERT_EQUAL(OUString("http://www.test.com/";), getProperty(getRun(xParagraph, 3), "HyperLinkURL")); - -CPPUNIT_ASSERT_EQUAL(OUString("Delete"), getProperty(getRun(xParagraph, 4), "RedlineType")); -CPPUNIT_ASSERT_EQUAL(sal_False, getProperty(getRun(xParagraph, 4), "IsStart")); - -getRun(xParagraph, 5, " After."); -} - /* * doesn't work on openSUSE12.2 at least DECLARE_OOXMLEXPORT_TEST(test1Table1Page, "1-table-1-page.docx") @@ -1115,17 +1085,6 @@ DECLARE_OOXMLEXPORT_TEST(testTransparentShadow, "transparent-shadow.docx") CPPUNIT_ASSERT_EQUAL(sal_Int16(50), nShadowTransparence); } -DECLARE_OOXMLEXPORT_TEST(testBnc834035, "bnc834035.odt") -{ -// Illustration index had wrong hyperlinks: anchor was using Writer's -// !|sequence syntax, not a bookmark name. -xmlDocPtr pXmlDoc = parseExport(); -if (!pXmlDoc) -return; -// This was Figure!1|sequence. -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 @@ -1689,13 +1648,6 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69644, "fdo69644.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol", 5); } -DECLARE_OOXMLEXPORT_TEST(testCp115, "cp115.odt") -{ -// Redline and hyperlink end got exported in an incorrect order. -getParagraph(1, "Hello."); -getParagraph(2, "http://www.google.com/";); -} - DECLARE_OOXMLEXPORT_TEST(testFdo70812, "fdo70812.docx") { // Import just crashed. @@ -1746,18 +1698,6 @@ DECLARE_OOXMLEXPORT_TEST(testLineSpacingexport, "test_line_spacing.docx") #endif } -DECLARE_OOXMLEXPORT_TEST(testHyperlineIsEnd, "hyperli
[Libreoffice-commits] core.git: sw/CppunitTest_sw_ooxmlfieldexport.mk
sw/CppunitTest_sw_ooxmlfieldexport.mk | 53 ++ 1 file changed, 53 insertions(+) New commits: commit 5748a5abbebe5fd9c39f19b9c7235609d6667a0b Author: Miklos Vajna Date: Thu Jul 17 17:35:22 2014 +0200 Add CppunitTest_sw_ooxmlfieldexport.mk Change-Id: Ib3c26cf90a26db31a3d145beeecc877ef57ab249 diff --git a/sw/CppunitTest_sw_ooxmlfieldexport.mk b/sw/CppunitTest_sw_ooxmlfieldexport.mk new file mode 100644 index 000..9e0171e --- /dev/null +++ b/sw/CppunitTest_sw_ooxmlfieldexport.mk @@ -0,0 +1,53 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#* +# +# 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/. +# +#* + +include $(SRCDIR)/sw/ooxmlexport_setup.mk + +$(eval $(call gb_CppunitTest_CppunitTest,sw_ooxmlfieldexport)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_ooxmlfieldexport, \ +sw/qa/extras/ooxmlexport/ooxmlfieldexport \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlfieldexport, \ + $(sw_ooxmlexport_libraries) \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_ooxmlfieldexport,\ + boost_headers \ +libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_ooxmlfieldexport,\ +-I$(SRCDIR)/sw/inc \ +-I$(SRCDIR)/sw/source/core/inc \ + -I$(SRCDIR)/sw/qa/extras/inc \ +$$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_ooxmlfieldexport,\ +offapi \ +udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_ooxmlfieldexport)) +$(eval $(call gb_CppunitTest_use_vcl,sw_ooxmlfieldexport)) + +$(eval $(call gb_CppunitTest_use_components,sw_ooxmlfieldexport,\ + $(sw_ooxmlexport_components) \ + filter/source/storagefilterdetect/storagefd \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_ooxmlfieldexport)) + +$(eval $(call gb_CppunitTest_use_unittest_configuration,sw_ooxmlfieldexport)) + +# vim: set noet sw=4 ts=4: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/unbalanced-columns-compat.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |8 writerfilter/source/dmapper/PropertyMap.cxx |9 + writerfilter/source/dmapper/PropertyMap.hxx |2 +- writerfilter/source/dmapper/SettingsTable.cxx| 10 ++ writerfilter/source/dmapper/SettingsTable.hxx|1 + 6 files changed, 25 insertions(+), 5 deletions(-) New commits: commit 9da4fe80c81b3464b2f6834052a24ce57c2fd07e Author: Miklos Vajna Date: Thu Jul 17 18:05:47 2014 +0200 DOCX import: handle compat setting Change-Id: Ieffd1fe52d6167d84ada5ebb11686f20d6dce8fa diff --git a/sw/qa/extras/ooxmlimport/data/unbalanced-columns-compat.docx b/sw/qa/extras/ooxmlimport/data/unbalanced-columns-compat.docx new file mode 100755 index 000..da980c8 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/unbalanced-columns-compat.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 9de6c29..061c393 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2282,6 +2282,14 @@ DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx") CPPUNIT_ASSERT_EQUAL(true, getProperty(xTextSections->getByIndex(2), "DontBalanceTextColumns")); } +DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.docx") +{ +uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); +// This was false, we ignored the relevant compat setting to make this non-last section unbalanced. +CPPUNIT_ASSERT_EQUAL(true, getProperty(xTextSections->getByIndex(0), "DontBalanceTextColumns")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 44a8168..3ec36cd 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -607,7 +607,7 @@ void SectionPropertyMap::SetBorderDistance( uno::Reference< beans::XPropertySet uno::Reference< text::XTextColumns > SectionPropertyMap::ApplyColumnProperties( -uno::Reference< beans::XPropertySet > xColumnContainer, bool bLast ) +uno::Reference< beans::XPropertySet > xColumnContainer, DomainMapper_Impl& rDM_Impl ) { uno::Reference< text::XTextColumns > xColumns; try @@ -659,7 +659,8 @@ uno::Reference< text::XTextColumns > SectionPropertyMap::ApplyColumnProperties( rPropNameSupplier.GetName( PROP_SEPARATOR_LINE_IS_ON ), uno::makeAny( m_bSeparatorLineIsOn )); xColumnContainer->setPropertyValue( sTextColumns, uno::makeAny( xColumns ) ); -if (bLast) +// Set the columns to be unbalanced if that compatability option is set or this is the last section. +if (rDM_Impl.GetSettingsTable()->GetNoColumnBalance() || rDM_Impl.GetIsLastSectionGroup()) xColumnContainer->setPropertyValue("DontBalanceTextColumns", uno::makeAny(true)); } catch( const uno::Exception& ) @@ -956,7 +957,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) uno::Reference< beans::XPropertySet > xSection = rDM_Impl.appendTextSectionAfter( m_xStartingRange ); if( m_nColumnCount > 0 && xSection.is()) -ApplyColumnProperties( xSection, rDM_Impl.GetIsLastSectionGroup() ); +ApplyColumnProperties( xSection, rDM_Impl ); uno::Reference xRangeProperties(lcl_GetRangeProperties(m_bIsFirstSection, rDM_Impl, m_xStartingRange)); if (xRangeProperties.is()) { @@ -1012,7 +1013,7 @@ void SectionPropertyMap::CloseSectionGroup( DomainMapper_Impl& rDM_Impl ) } uno::Reference< text::XTextColumns > xColumns; if( m_nColumnCount > 0 ) -xColumns = ApplyColumnProperties( xFollowPageStyle, rDM_Impl.GetIsLastSectionGroup() ); +xColumns = ApplyColumnProperties( xFollowPageStyle, rDM_Impl ); //prepare text grid properties sal_Int32 nHeight = 1; diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx index 59a6559..98e4a1f 100644 --- a/writerfilter/source/dmapper/PropertyMap.hxx +++ b/writerfilter/source/dmapper/PropertyMap.hxx @@ -203,7 +203,7 @@ class SectionPropertyMap : public PropertyMap void _ApplyProperties( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xStyle ); ::com::sun::star::uno::Referenc
[Libreoffice-commits] core.git: unoxml/source
unoxml/source/dom/elementlist.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c6a7c5ee5abb867edbdd5a35f1f6c06cee8cab0b Author: Miklos Vajna Date: Fri Jul 18 10:18:46 2014 +0200 loplugin:saloverride Change-Id: I27600820acb4a432840ef9bc7220fc3d4bb6a273 diff --git a/unoxml/source/dom/elementlist.hxx b/unoxml/source/dom/elementlist.hxx index 18289e6..51baa03 100644 --- a/unoxml/source/dom/elementlist.hxx +++ b/unoxml/source/dom/elementlist.hxx @@ -71,7 +71,7 @@ namespace DOM void registerListener(CElement & rElement); -~CElementListImpl(); +virtual ~CElementListImpl(); /** The number of nodes in the list. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/unbalanced-columns-compat.rtf |7 +++ sw/qa/extras/rtfimport/rtfimport.cxx |8 writerfilter/source/rtftok/rtfdocumentimpl.cxx|3 +++ 3 files changed, 18 insertions(+) New commits: commit 6f2b2e1436fe3917c1fcace2f1e2d34416311996 Author: Miklos Vajna Date: Fri Jul 18 10:50:54 2014 +0200 writerfilter: import RTF_NOCOLBAL Change-Id: If2efab82c0adc2f3dc52733c335693565c350bfa diff --git a/sw/qa/extras/rtfimport/data/unbalanced-columns-compat.rtf b/sw/qa/extras/rtfimport/data/unbalanced-columns-compat.rtf new file mode 100644 index 000..1e4b17e --- /dev/null +++ b/sw/qa/extras/rtfimport/data/unbalanced-columns-compat.rtf @@ -0,0 +1,7 @@ +{\rtf1 +\nocolbal\sectd\cols2\pard\plain +This is in the left column.\par +This is the second line, in the same column.\par +\sect\sectd\sbknone\pard\plain +After section break.\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 76de5bb..a2ff94f 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1784,6 +1784,14 @@ DECLARE_RTFIMPORT_TEST(testFdo80905, "fdo80905.rtf") CPPUNIT_ASSERT_EQUAL(true, static_cast(xFields->hasMoreElements())); } +DECLARE_RTFIMPORT_TEST(testUnbalancedColumnsCompat, "unbalanced-columns-compat.rtf") +{ +uno::Reference xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY); +// This was false, we ignored the relevant compat setting to make this non-last section unbalanced. +CPPUNIT_ASSERT_EQUAL(true, getProperty(xTextSections->getByIndex(0), "DontBalanceTextColumns")); +} + 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 8d54a69..6fe2bdc 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -3311,6 +3311,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) case RTF_BRDRSH: lcl_putBorderProperty(m_aStates, NS_ooxml::LN_CT_Border_shadow, RTFValue::Pointer_t(new RTFValue(1))); break; +case RTF_NOCOLBAL: +m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Compat_noColumnBalance, RTFValue::Pointer_t(new RTFValue(1))); +break; default: { SAL_INFO("writerfilter", "TODO handle flag '" << lcl_RtfToString(nKeyword) << "'"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: prettyprint/zipdiff
prettyprint/zipdiff | 64 1 file changed, 64 insertions(+) New commits: commit f2713985b034438ab9ae52dbd09d4bd0186cc039 Author: Miklos Vajna Date: Fri Jul 18 14:18:01 2014 +0200 prettyprint: add zipdiff script Change-Id: I5222798d326a21dd2f4170df3880cf1af4deca9d diff --git a/prettyprint/zipdiff b/prettyprint/zipdiff new file mode 100755 index 000..b1a39dc --- /dev/null +++ b/prettyprint/zipdiff @@ -0,0 +1,64 @@ +#!/bin/bash +# +# 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/. +# + +# For ODF, there is flat ODF, but for other XML-based zipped formats, you have +# to unpack the archive and compare each file manually. +# +# This script tries to automate that: you can diff archive contents as well XML +# contents as well. + +# Allow symlinking to ~/bin while still finding formatxml next to us in the original location. +mydir=$(dirname $0) +[ -h $0 ] && mydir=$(dirname $(readlink $0)) + +unpack() +{ +mkdir $1 +cd $1 +unzip -q $2 +if [ -z "$filesOnly" ]; then +for i in $(find . -name "*.xml" -o -name "*.rels") +do +$mydir/formatxml "$i" > "$i-new" +mv -f "$i-new" "$i" +done +fi +cd .. +} + +filesOnly= +if [ "$1" = "-f" ]; then +shift +filesOnly=t +fi + +if [ -z "$1" -o -z "$2" ]; then +echo "usage: zipdiff [-f] onefile otherfile" +echo +echo "-fdiff only the list of files, not their contents" +exit 1 +fi + +a=$(realpath $1) +b=$(realpath $2) +workdir=$(mktemp -d) +cd $workdir +unpack a $a +unpack b $b + +if [ -n "$filesOnly" ]; then +find a -mindepth 1 |sed 's|^a/||' |sort > a-list +find b -mindepth 1 |sed 's|^b/||' |sort > b-list +diff -u a-list b-list +else +diff -Nur a b +fi +rm -rf $workdir + +# vim:set shiftwidth=4 softtabstop=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - oox/source sw/qa
oox/source/core/xmlfilterbase.cxx| 25 +++-- sw/qa/extras/ooxmlexport/data/zoom.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |1 + 3 files changed, 16 insertions(+), 10 deletions(-) New commits: commit 9f2dc12e611e5706469889c03fa5b11a6ab6e297 Author: Miklos Vajna Date: Fri Jul 18 15:04:37 2014 +0200 Use comphelper::SequenceAsHashMap Change-Id: I5e4dc99c86b696d2c00392fdb47c4d9ebb7f14ff diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index acc8805..f236a9e 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -667,33 +667,23 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp writeElement( pAppProps, XML_DocSecurity, "doc security" ); #endif /* def OOXTODO */ -uno::Sequence aStats = xProperties->getDocumentStatistics(); -for (sal_Int32 i = 0; i < aStats.getLength(); ++i) +comphelper::SequenceAsHashMap aStats = xProperties->getDocumentStatistics(); +comphelper::SequenceAsHashMap::iterator it = aStats.find("ParagraphCount"); +if (it != aStats.end()) { -if (aStats[i].Name == "ParagraphCount") -{ sal_Int32 nValue = 0; -if (aStats[i].Value >>= nValue) -{ +if (it->second >>= nValue) writeElement(pAppProps, XML_Paragraphs, OUString::number(nValue)); -break; -} -} } uno::Reference xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); -const uno::Sequence aUserDefinedProperties = xUserDefinedProperties->getPropertyValues(); -for (sal_Int32 i = 0; i < aUserDefinedProperties.getLength(); ++i) +comphelper::SequenceAsHashMap aUserDefinedProperties(xUserDefinedProperties->getPropertyValues()); +it = aUserDefinedProperties.find("Company"); +if (it != aStats.end()) { -if (aUserDefinedProperties[i].Name == "Company") -{ -OUString aValue; -if (aUserDefinedProperties[i].Value >>= aValue) -{ -writeElement(pAppProps, XML_Company, aValue); -break; -} -} +OUString aValue; +if (it->second >>= aValue) +writeElement(pAppProps, XML_Company, aValue); } pAppProps->endElement( XML_Properties ); commit 84a5720f9ae42b98db99e0affd04b7d16ac742cd Author: Miklos Vajna Date: Fri Jul 18 14:36:15 2014 +0200 oox: write Company in docProps/app.xml Change-Id: I8474b8ec7415b4d8e067343295ea985319c34834 diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index af0567b..acc8805 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -637,7 +638,6 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp writeElement( pAppProps, XML_Template, xProperties->getTemplateName() ); #ifdef OOXTODO writeElement( pAppProps, XML_Manager, "manager" ); -writeElement( pAppProps, XML_Company, "company" ); writeElement( pAppProps, XML_Pages, "pages" ); writeElement( pAppProps, XML_Words, "words" ); writeElement( pAppProps, XML_Characters,"characters" ); @@ -681,6 +681,21 @@ writeAppProperties( XmlFilterBase& rSelf, Reference< XDocumentProperties > xProp } } +uno::Reference xUserDefinedProperties(xProperties->getUserDefinedProperties(), uno::UNO_QUERY); +const uno::Sequence aUserDefinedProperties = xUserDefinedProperties->getPropertyValues(); +for (sal_Int32 i = 0; i < aUserDefinedProperties.getLength(); ++i) +{ +if (aUserDefinedProperties[i].Name == "Company") +{ +OUString aValue; +if (aUserDefinedProperties[i].Value >>= aValue) +{ +writeElement(pAppProps, XML_Company, aValue); +break; +} +} +} + pAppProps->endElement( XML_Properties ); } diff --git a/sw/qa/extras/ooxmlexport/data/zoom.docx b/sw/qa/extras/ooxmlexport/data/zoom.docx index a61069f..ce93a1a 100644 Binary files a/sw/qa/extras/ooxmlexport/data/zoom.docx and b/sw/qa/extras/ooxmlexport/data/zoom.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 2ef9160..e7934b2 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -99,6 +99,7 @@ DECLARE_OOXMLEXPORT_TEST(testZoom, "zoom.docx")
[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 Date: Fri Jul 18 16:46:43 2014 +0200 DOCX export: handle 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::Sequence aGrabBag; uno::Reference 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::Reference 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 Date: Fri Jul 18 16:41:09 2014 +0200 DOCX import: handle 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::vector aItems; createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), rContentText, aItems), xControlModel, aGrabBag.getAsConstPropertyValueList()); commit 7916ca62209ee32c46c264b8cbf0a28b1c23a2a8 Author: Miklos Vajna 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 #include +#include #include #include #include @@ -121,19 +122,15 @@
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dd664f2e10bdada705c78638fe95ad0869b7cb03 Author: Miklos Vajna Date: Thu Jul 17 22:24:54 2014 +0200 CppunitTest_sw_ooxmlfieldexport: enable on OS X Change-Id: I3ded4fc864870c20e0e5a7dc0aef02ca7b792ebc Reviewed-on: https://gerrit.libreoffice.org/10372 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 2570412..5d2732b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -9,7 +9,7 @@ #include -#if !defined(MACOSX) && !defined(WNT) +#if !defined(WNT) #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/rtfimport/rtfimport.cxx |9 +--- writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 writerfilter/source/rtftok/rtfsdrimport.cxx| 55 + writerfilter/source/rtftok/rtfsdrimport.hxx| 14 +++--- 4 files changed, 41 insertions(+), 39 deletions(-) New commits: commit 90d2ebf7a74fa703db5b080ab54181319696a54a Author: Miklos Vajna Date: Sat Jul 19 10:17:20 2014 +0200 indentation fixes Change-Id: I2c1f99128698778233b0bd46256b571d3f794713 diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 06b6593..9784736 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -889,17 +889,14 @@ DECLARE_RTFIMPORT_TEST(testFdo79319, "fdo79319.rtf") { // the thin horizontal rule was imported as a big fat rectangle uno::Reference xShape(getShape(1), uno::UNO_QUERY); -CPPUNIT_ASSERT_EQUAL(sal_Int16(100), -getProperty(xShape, "RelativeWidth")); +CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty(xShape, "RelativeWidth")); // FIXME the width/height numbers here are bogus; they should be 15238 / 53 // (as they are when opening the file in a full soffice) #if 0 CPPUNIT_ASSERT_EQUAL(sal_Int32(15238), xShape->getSize().Width); CPPUNIT_ASSERT_EQUAL(sal_Int32(53), xShape->getSize().Height); -CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, -getProperty(xShape, "VertOrient")); -CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, -getProperty(xShape, "HoriOrient")); +CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty(xShape, "VertOrient")); +CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty(xShape, "HoriOrient")); #endif } diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 5946642..879bc22 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -5572,7 +5572,7 @@ int RTFDocumentImpl::popState() } break; case DESTINATION_LISTNAME: -break; +break; case DESTINATION_LISTLEVEL: { RTFValue::Pointer_t pInnerValue(new RTFValue(m_aStates.top().nListLevelNum++)); diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 399c008..d8aa4a3 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -217,11 +217,10 @@ void RTFSdrImport::applyProperty(uno::Reference xShape, const O } } -int RTFSdrImport::initShape( -uno::Reference & o_xShape, -uno::Reference & o_xPropSet, -bool & o_rIsCustomShape, -RTFShape const& rShape, bool const bClose, ShapeOrPict const shapeOrPict) +int RTFSdrImport::initShape(uno::Reference& o_xShape, +uno::Reference& o_xPropSet, +bool& o_rIsCustomShape, +RTFShape const& rShape, bool const bClose, ShapeOrPict const shapeOrPict) { assert(!o_xShape.is()); assert(!o_xPropSet.is()); @@ -234,8 +233,8 @@ int RTFSdrImport::initShape( std::find_if(rShape.aProperties.begin(), rShape.aProperties.end(), boost::bind(&OUString::equals, - boost::bind(&std::pair::first, _1), - OUString("shapeType"; + boost::bind(&std::pair::first, _1), + OUString("shapeType"; if (iter == rShape.aProperties.end()) { @@ -246,7 +245,8 @@ int RTFSdrImport::initShape( nType = ESCHER_ShpInst_Rectangle; } else -{ // pict is picture by default but can be a rectangle too fdo#79319 +{ +// pict is picture by default but can be a rectangle too fdo#79319 nType = ESCHER_ShpInst_PictureFrame; } } @@ -289,8 +289,7 @@ int RTFSdrImport::initShape( // Defaults if (o_xPropSet.is() && !m_bTextFrame) { -o_xPropSet->setPropertyValue("FillColor", uno::makeAny(sal_uInt32( -0xff))); // White in Word, kind of blue in Writer. +o_xPropSet->setPropertyValue("FillColor", uno::makeAny(sal_uInt32(0xff))); // White in Word, kind of blue in Writer. } return nType; @@ -327,8 +326,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap sal_Int16 nRelativeHeightRelation = text::RelOrientation::PAGE_FRAME; bool bCustom(false); -int const nType = -initShape(xShape, xPropertySet, bCustom, rShape, bClose, shapeOrPict); +int const nType = initShape(xSha
[Libreoffice-commits] core.git: oox/source sw/qa sw/source writerfilter/source
oox/source/shape/WpsContext.cxx|4 ++-- sw/qa/extras/rtfimport/rtfimport.cxx |3 +-- sw/source/filter/ww8/docxsdrexport.cxx |2 +- writerfilter/source/dmapper/SdtHelper.cxx |7 ++- writerfilter/source/dmapper/SdtHelper.hxx |7 ++- writerfilter/source/rtftok/rtfdocumentimpl.cxx |7 ++- writerfilter/source/rtftok/rtfdocumentimpl.hxx |2 +- writerfilter/source/rtftok/rtfsdrimport.cxx|3 +-- writerfilter/source/rtftok/rtfvalue.hxx|8 9 files changed, 16 insertions(+), 27 deletions(-) New commits: commit 2198168af134e7f72afcc07ff5062324a19d Author: Miklos Vajna Date: Sun Jul 27 17:30:48 2014 +0200 indentation fixes Change-Id: I0a0f04d0f0e008e8947a5a7e3ed6083c1589e61b diff --git a/oox/source/shape/WpsContext.cxx b/oox/source/shape/WpsContext.cxx index 89ed320..fb42e62 100644 --- a/oox/source/shape/WpsContext.cxx +++ b/oox/source/shape/WpsContext.cxx @@ -128,10 +128,10 @@ oox::core::ContextHandlerRef WpsContext::onCreateContext(sal_Int32 nElementToken } break; case XML_prstTxWarp: -if( rAttribs.hasAttribute( XML_prst ) ) +if (rAttribs.hasAttribute(XML_prst)) { uno::Reference xPropertySet(mxShape, uno::UNO_QUERY); -oox::OptValue presetShapeName = rAttribs.getString( XML_prst ); +oox::OptValue presetShapeName = rAttribs.getString(XML_prst); OUString preset = presetShapeName.get(); comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); aCustomShapeGeometry["PresetTextWarp"] = uno::makeAny(preset); diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 289cce8..f7763b3 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1337,8 +1337,7 @@ DECLARE_RTFIMPORT_TEST(testFdo77996, "fdo77996.rtf") uno::Reference xDocumentPropertiesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference xProps(xDocumentPropertiesSupplier->getDocumentProperties()); CPPUNIT_ASSERT_EQUAL(OUString("Aln Lin (Bei Jing)"), xProps->getAuthor()); -OUString aTitle("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, -RTL_TEXTENCODING_UTF8); +OUString aTitle("\xe5\x8e\xa6\xe9\x97\xa8\xe9\x92\xa8\xe4\xb8\x9a\xe8\x82\xa1\xe4\xbb\xbd\xe6\x9c\x89\xe9\x99\x90\xe5\x85\xac\xe5\x8f\xb8", 30, RTL_TEXTENCODING_UTF8); CPPUNIT_ASSERT_EQUAL(aTitle, xProps->getTitle()); uno::Reference xUDProps(xProps->getUserDefinedProperties(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("jay"), getProperty(xUDProps, "Operator")); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 8e137d9..9429443 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -853,7 +853,7 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* sdrObj, const SwFrmFm // In case we are already inside a DML block, then write the shape only as VML, turn out that's allowed to do. // A common service created in util to check for VML shapes which are allowed to have textbox in content -if ( (msfilter::util::HasTextBoxContent(eShapeType)) && m_pImpl->isSupportedDMLShape(xShape) && !bDMLAndVMLDrawingOpen) +if ((msfilter::util::HasTextBoxContent(eShapeType)) && m_pImpl->isSupportedDMLShape(xShape) && !bDMLAndVMLDrawingOpen) { m_pImpl->m_pSerializer->startElementNS(XML_mc, XML_AlternateContent, FSEND); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index 671e4c2..ce57d60 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -135,15 +135,12 @@ void SdtHelper::createDateControl(OUString& rContentText, beans::PropertyValue a createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), rContentText, aItems), xControlModel, aGrabBag.getAsConstPropertyValueList()); } -void SdtHelper::createControlShape(awt::Size aSize, -uno::Reference const& xControlModel) +void SdtHelper::createControlShape(awt::Size aSize, uno::Reference const& xControlModel) { createControlShape(aSize, xControlModel, uno::Sequence()); } -void SdtHelper::createControlShape(awt::Size aSize, -uno::Reference const& xControlModel, -const uno::Sequence& rGrabBag) +void SdtHelper::createControlShape(awt::Size aSize, uno::Reference const& xControlModel, const uno::Sequence& rGrabBag) { uno::Reference xControlShape(m_rDM_Impl.GetTextFactory()->createInstance(&q
[Libreoffice-commits] core.git: writerfilter/CustomTarget_source.mk writerfilter/source
writerfilter/CustomTarget_source.mk | 11 writerfilter/source/ooxml/factoryimpl_ns.py | 715 writerfilter/source/ooxml/factoryimpl_ns.xsl | 945 --- writerfilter/source/ooxml/factorytools.xsl | 262 --- 4 files changed, 719 insertions(+), 1214 deletions(-) New commits: commit 821ab16a1fb0353397914131ab559685d12b92b7 Author: Miklos Vajna Date: Sun Jul 27 17:46:42 2014 +0200 writerfilter: convert factoryimpl_ns to Python Change-Id: Ia2380a23e31583f40a368168bc09d7fddd3e4ab7 diff --git a/writerfilter/CustomTarget_source.mk b/writerfilter/CustomTarget_source.mk index b84e235..6ff9c09 100644 --- a/writerfilter/CustomTarget_source.mk +++ b/writerfilter/CustomTarget_source.mk @@ -12,7 +12,6 @@ $(eval $(call gb_CustomTarget_CustomTarget,writerfilter/source)) writerfilter_WORK := $(call gb_CustomTarget_get_workdir,writerfilter/source) writerfilter_SRC := $(SRCDIR)/writerfilter/source -writerfilter_XSLTCOMMAND := $(call gb_ExternalExecutable_get_command,xsltproc) writerfilter_PYTHONCOMMAND := $(call gb_ExternalExecutable_get_command,python) writerfilter_OOXMLNAMESPACES= \ @@ -66,11 +65,9 @@ writerfilter_GEN_ooxml_FastTokens_hxx=$(writerfilter_WORK)/ooxml/OOXMLFastTokens writerfilter_GEN_ooxml_GperfFastToken_hxx=$(writerfilter_WORK)/ooxml/gperffasttoken.hxx writerfilter_GEN_ooxml_Model_processed=$(writerfilter_WORK)/ooxml/model_preprocessed.xml writerfilter_GEN_ooxml_NamespaceIds_hxx=$(writerfilter_WORK)/ooxml/OOXMLnamespaceids.hxx -writerfilter_GEN_ooxml_Namespacesmap_xsl=$(writerfilter_WORK)/ooxml/namespacesmap.xsl writerfilter_GEN_ooxml_QNameToStr_cxx=$(writerfilter_WORK)/ooxml/qnametostr.cxx writerfilter_GEN_ooxml_ResourceIds_hxx=$(writerfilter_WORK)/ooxml/resourceids.hxx writerfilter_GEN_ooxml_Token_xml=$(writerfilter_WORK)/ooxml/token.xml -writerfilter_SRC_ooxml_FactoryTools_xsl=$(writerfilter_SRC)/ooxml/factorytools.xsl writerfilter_SRC_ooxml_FactoryValues_py=$(writerfilter_SRC)/ooxml/factory_values.py writerfilter_SRC_ooxml_FastTokens_py=$(writerfilter_SRC)/ooxml/fasttokens.py writerfilter_SRC_ooxml_GperfFastTokenHandler_py=$(writerfilter_SRC)/ooxml/gperffasttokenhandler.py @@ -121,9 +118,9 @@ $(writerfilter_GEN_ooxml_Token_xml) : $(SRCDIR)/oox/source/token/tokens.txt $(wr sed -f $(writerfilter_SRC)/ooxml/tokens-to-xml.sed \ < $(SRCDIR)/oox/source/token/tokens.txt > $@ -$(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : $(writerfilter_SRC)/ooxml/factoryimpl_ns.xsl $(writerfilter_GEN_ooxml_Model_processed) - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,XSL,1) - $(call gb_Helper_abbreviate_dirs, $(writerfilter_XSLTCOMMAND) --stringparam file $@ $< $(writerfilter_GEN_ooxml_Model_processed)) > $@ +$(writerfilter_WORK)/ooxml/OOXMLFactory%.cxx : $(writerfilter_SRC)/ooxml/factoryimpl_ns.py $(writerfilter_GEN_ooxml_Model_processed) + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) + $(call gb_Helper_abbreviate_dirs, $(writerfilter_PYTHONCOMMAND) $< $(writerfilter_GEN_ooxml_Model_processed) $@) > $@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : $(writerfilter_SRC)/ooxml/factory_ns.py $(writerfilter_GEN_ooxml_Model_processed) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PY ,1) @@ -132,6 +129,6 @@ $(writerfilter_WORK)/ooxml/OOXMLFactory%.hxx : $(writerfilter_SRC)/ooxml/factory $(call gb_CustomTarget_get_target,writerfilter/source) : $(writerfilter_ALL) -$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc) $(call gb_ExternalExecutable_get_dependencies,python) $(writerfilter_WORK)/ooxml/.dir +$(writerfilter_ALL) :| $(call gb_ExternalExecutable_get_dependencies,python) $(writerfilter_WORK)/ooxml/.dir # vim: set noet sw=4 ts=4: diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py new file mode 100644 index 000..4dc8ff0 --- /dev/null +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -0,0 +1,715 @@ +#!/usr/bin/env python +# +# 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/. +# + +from __future__ import print_function +from xml.dom import minidom +import sys + + +# factoryMutexDecl + + +def factoryMutexDecl(nsLabel): +print("typedef rtl::Static OOXMLFactory_%s_Mutex;" % (nsLabel, nsLabel)) +print() + + +# factoryConstructor + + +def factoryConstructor(nsLabel): +print("""OOXMLFactory_%s::OOXMLFactory_%s() +{ +// multi-thread-safe mutex for all platforms + +osl::MutexGuard aGuard(OOXMLFactory_%s_Mutex::get()); +}""" % (nsLabel, nsLabel, nsLabel)) +print() + + +# factoryDestructor + + +def factoryDestructor(nsLabel): +print("&qu
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 15 ++ sw/source/filter/ww8/ww8atr.cxx |2 - 3 files changed, 12 insertions(+), 5 deletions(-) New commits: commit 7146d8bcd96f844dc0239a5b29a6b36c3cb5a2cc Author: Miklos Vajna Date: Mon Jul 28 16:58:38 2014 +0200 MSWordExportBase::OutputSectionBreaks: avoid fake section breaks Regression from ee9f23bb94b4c2c8c4db6466ecca272a092e9492 (docx export: invalid sectPr added at the beginning of the doc, 2013-01-10), the problem was that we even tried to generate section breaks at places where the two page styles are in practice the same. Change-Id: Iccf91ce542d9b075b93da25bcd42236db667e3d4 diff --git a/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx new file mode 100644 index 000..a8565742 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/unwanted-section-break.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 1fdc15e..77d8b4c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2532,7 +2532,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo77718, "fdo77718.docx") DECLARE_OOXMLEXPORT_TEST(testTableCurruption, "tableCurrupt.docx") { -xmlDocPtr pXmlDoc = parseExport("word/header4.xml"); +xmlDocPtr pXmlDoc = parseExport("word/header2.xml"); if (!pXmlDoc) return; CPPUNIT_ASSERT(pXmlDoc) ; @@ -2635,7 +2635,7 @@ DECLARE_OOXMLEXPORT_TEST(testOLEObjectinHeader, "2129393649.docx") // Problem was relationship entry for oleobject from header was // exported into document.xml.rels file because of this rels file // for headers were missing from document/word/rels. -xmlDocPtr pXmlDoc = parseExport("word/_rels/header3.xml.rels"); +xmlDocPtr pXmlDoc = parseExport("word/_rels/header1.xml.rels"); if(!pXmlDoc) return; @@ -2971,12 +2971,12 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx") DECLARE_OOXMLEXPORT_TEST(testfdo78420, "fdo78420.docx") { -xmlDocPtr pXmlHeader = parseExport("word/header3.xml"); +xmlDocPtr pXmlHeader = parseExport("word/header2.xml"); if (!pXmlHeader) return; -xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header3.xml.rels"); +xmlDocPtr pXmlHeaderRels = parseExport("word/_rels/header2.xml.rels"); if(!pXmlHeaderRels) return; @@ -3409,6 +3409,13 @@ DECLARE_OOXMLEXPORT_TEST(testPlausableBorder, "plausable-border.docx") assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:br", 1); } +DECLARE_OOXMLEXPORT_TEST(testUnwantedSectionBreak, "unwanted-section-break.docx") +{ +if (xmlDocPtr pXmlDoc = parseExport()) +// This was 2: an additional sectPr was added to the document. +assertXPath(pXmlDoc, "//w:sectPr", 1); +} + DECLARE_OOXMLEXPORT_TEST(testfdo80897 , "fdo80897.docx") { xmlDocPtr pXmlDoc = parseExport(); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 6de7aec..e831bf7 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -443,7 +443,7 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode if ( isCellOpen && ( pAktPageDesc->GetName() != pPageDesc->GetName() ) ) pSet = NULL; } -else +else if (!sw::util::IsPlausableSingleWordSection(pAktPageDesc->GetFirstMaster(), pPageDesc->GetMaster())) { bBreakSet = true; bNewPageDesc = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: libreofficekit/source
libreofficekit/source/gtk/lokdocview.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit 1cde56c3600b5b5b006609c24bfcaf66887167d3 Author: Miklos Vajna Date: Mon Jul 28 17:41:41 2014 +0200 -Werror=declaration-after-statement Change-Id: I97b1d03410e98c5ff2ad3cc15cef692e9b994a6c diff --git a/libreofficekit/source/gtk/lokdocview.c b/libreofficekit/source/gtk/lokdocview.c index e8fe526..07d07a1 100644 --- a/libreofficekit/source/gtk/lokdocview.c +++ b/libreofficekit/source/gtk/lokdocview.c @@ -98,6 +98,13 @@ void renderDocument( LOKDocView* pDocView ) int nRenderWidth, nRenderHeight; unsigned char* pBuffer; int nRowStride; +// TODO: we really should scale by screen DPI here -- 10 seems to be a vaguely +// correct factor for my screen at least. +const float fScaleFactor = 0.1; + +// Various things blow up if we try to draw too large a tile, +// this size seems to be safe. (Very rare/unlikely that +const int nMaxWidth = 10; g_assert( pDocView->pDocument ); @@ -108,13 +115,6 @@ void renderDocument( LOKDocView* pDocView ) pDocView->pDocument->pClass->getDocumentSize( pDocView->pDocument, &nWidth, &nHeight ); -// TODO: we really should scale by screen DPI here -- 10 seems to be a vaguely -// correct factor for my screen at least. -const float fScaleFactor = 0.1; - -// Various things blow up if we try to draw too large a tile, -// this size seems to be safe. (Very rare/unlikely that -const int nMaxWidth = 10; if ( nWidth * fScaleFactor > nMaxWidth ) { nWidth = nMaxWidth; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 2 commits - writerfilter/qa writerfilter/source
writerfilter/qa/ooxml/watch-generated-code.sh | 47 ++ writerfilter/source/ooxml/factoryimpl_ns.py |8 +--- 2 files changed, 49 insertions(+), 6 deletions(-) New commits: commit 29813244afafa1721feb63dfeb055594053ce3f7 Author: Miklos Vajna Date: Mon Jul 28 18:12:00 2014 +0200 writerfilter: unneeded whitespace tweak Change-Id: Ib25ae32be6132a9209eaa81db18b0659b73d5b82 diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py index 4dc8ff0..38ffa51 100644 --- a/writerfilter/source/ooxml/factoryimpl_ns.py +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -420,12 +420,8 @@ def factoryAction(nsNode, action): switchblock1.append("case %s:" % idForDefine(nsNode, resourceNode)) for actionNode in [i for i in getChildrenByName(resourceNode, "action") if i.getAttribute("name") == action]: switchblock1.extend(factoryChooseAction(actionNode)) -if action == "characters": -switchblock1.append("break;") -switchblock1.append("") -else: -switchblock1[-1] += " break;" -switchblock1.append("") +switchblock1.append("break;") +switchblock1.append("") switchblock2 = [] if action == "characters": commit 17969321130f293adfed6f9350faaa8e59e4aa8f Author: Miklos Vajna Date: Mon Jul 28 18:09:56 2014 +0200 writerfilter: add script to detect generated code changes Change-Id: I340ef55dc9a09bd196469ed51848b22ba986de8c diff --git a/writerfilter/qa/ooxml/watch-generated-code.sh b/writerfilter/qa/ooxml/watch-generated-code.sh new file mode 100755 index 000..86acaf7 --- /dev/null +++ b/writerfilter/qa/ooxml/watch-generated-code.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +if [ ! -e bin/get_config_variables ]; then +cd ../../.. +fi + +. bin/get_config_variables SRCDIR + +if [ "$PWD" != "$SRCDIR" ]; then +echo "error: not in the expected SRCDIR" +exit 1 +fi + +cd writerfilter +echo 'include Makefile' > watch.mk +echo 'watch:' >> watch.mk +echo $'\techo $(writerfilter_ALL)' >> watch.mk +mydir=workdir/CustomTarget/writerfilter +writerfilter_ALL=$(make -sr -f watch.mk watch|sed "s|$SRCDIR/$mydir/||g") +rm watch.mk +cd - >/dev/null + +case $1 in +reference) +rm -rf $mydir-reference +mkdir -p $mydir-reference/source/ooxml +for i in $writerfilter_ALL +do +cp $mydir/$i $mydir-reference/$i +done +;; +compare) +for i in $writerfilter_ALL +do +diff -u $mydir-reference/$i $mydir/$i +done +;; +*) +echo "usage: $0 [ reference | compare ]" +echo +echo "$0 first saves a reference output of all generated files by writerfilter, then" +echo "allows comparing against it. This helps seeing the effect of changes made on" +echo "the code generator scripts." +;; +esac + +# vi:set shiftwidth=4 expandtab: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/qa writerfilter/source
writerfilter/qa/ooxml/watch-generated-code.sh |3 +++ writerfilter/source/ooxml/modelpreprocess.py |9 - 2 files changed, 3 insertions(+), 9 deletions(-) New commits: commit 1b30426c818a7a45a3cb429b8b3c45b634ad2ab9 Author: Miklos Vajna Date: Mon Jul 28 18:23:46 2014 +0200 writerfilter: nobody reads the classfordefine attribute Change-Id: I030137cb379de04968fb144516e90dbd1bdd97f6 diff --git a/writerfilter/qa/ooxml/watch-generated-code.sh b/writerfilter/qa/ooxml/watch-generated-code.sh index 86acaf7..d674573 100755 --- a/writerfilter/qa/ooxml/watch-generated-code.sh +++ b/writerfilter/qa/ooxml/watch-generated-code.sh @@ -32,6 +32,9 @@ reference) compare) for i in $writerfilter_ALL do +if [ "$(basename $i)" == "model_preprocessed.xml" ]; then +continue +fi diff -u $mydir-reference/$i $mydir/$i done ;; diff --git a/writerfilter/source/ooxml/modelpreprocess.py b/writerfilter/source/ooxml/modelpreprocess.py index 022568f..82e5e3f 100644 --- a/writerfilter/source/ooxml/modelpreprocess.py +++ b/writerfilter/source/ooxml/modelpreprocess.py @@ -149,15 +149,6 @@ def preprocess(model): j.setAttribute("prefix", prefix) j.setAttribute("localname", localname) -for j in i.getElementsByTagName("define") + i.getElementsByTagName("ref"): -name = j.getAttribute("name") -if name.startswith("CT_") or name.startswith("EG_") or name.startswith("AG_"): -j.setAttribute("classfordefine", "1") -elif name in startElements: -j.setAttribute("classfordefine", "1") -else: -j.setAttribute("classfordefine", "0") - for i in model.getElementsByTagName("grammar"): if i.getAttribute("ns").startswith("http://schemas.openxmlformats.org/";): i.setAttribute("application", i.getAttribute("ns").replace('http://schemas.openxmlformats.org/', '').split('/')[0]) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit a0b89100be8ccc2b60d08d7e3819cd247a6042b0 Author: Miklos Vajna Date: Tue Jul 29 11:19:56 2014 +0200 DOCX import: handle ooxml::CT_Spacing_lineRule after line Regression from commit a5f9fb720daeb2df8325768b98b8b720abcc2b9b (fdo#80800 : DOCX: Preservation of Direct Formatting for non first Table Cells, 2014-07-11), CT_Spacing's two attributes (line and lineRule) may come in different order; but the change only handled the case when lineRule is followed by line, and not the other way around. This fixes a unit test failure in CppunitTest_sw_ooxmlexport's testSpacingLineRule. Change-Id: I892d97a97390228a59a129f096be39ce93b822d6 diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 7e598d7..c32d86a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -428,6 +428,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) m_pImpl->appendGrabBag(m_pImpl->m_aSubInteropGrabBag, "lineRule", "exact"); aSpacing.Mode = style::LineSpacingMode::FIX; } + +if( m_pImpl->getTableManager().isInCell() ) +{ +// If the table manager got the line rule after +// ooxml::CT_Spacing_line, then it should get the rule +// after lineRule as well. +TablePropertyMapPtr pTblCellWithDirectFormatting(new TablePropertyMap); +pTblCellWithDirectFormatting->insert(std::pair< PropertyIds, PropValue >(PROP_PARA_LINE_SPACING, uno::makeAny( aSpacing ))); + m_pImpl->getTableManager().cellProps(pTblCellWithDirectFormatting); +} } if (pTopContext) pTopContext->Insert(PROP_PARA_LINE_SPACING, uno::makeAny( aSpacing )); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa sw/source writerfilter/source
sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 18 ++--- sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx| 10 +++ sw/source/filter/ww8/docxattributeoutput.cxx | 70 --- sw/source/filter/ww8/docxattributeoutput.hxx |4 + writerfilter/source/dmapper/DomainMapper.cxx |7 +- writerfilter/source/dmapper/SdtHelper.cxx|1 writerfilter/source/dmapper/SdtHelper.hxx| 12 +++ 8 files changed, 104 insertions(+), 18 deletions(-) New commits: commit 28a315694348c4d1a4fd9aea7e720b3e821e8eb3 Author: Miklos Vajna Date: Tue Jul 29 17:56:08 2014 +0200 DOCX filter: map outside paragraphs to paragraph properties Previously the type of the SDT was used to decide if the SDT will be a character or paragraph property. Improve this situation by always mapping elements outside paragraph to paragraph properties. In practice, this means that if the SDT was a rectangle (as it wasn't only around a run), then it remains so, while previously it could become a polygon instead (when painted). Fix several testcases that tested that a outside a paragraph is exported as a character property. Change-Id: Ia26c1a4cf6bc553b46224e4b17ee40725c5f3622 diff --git a/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx b/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx new file mode 100644 index 000..c86f599 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/paragraph-sdt.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 77d8b4c..207ad5b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2603,9 +2603,9 @@ DECLARE_OOXMLEXPORT_TEST(testCheckBoxControl, "checkbox-control.docx") xmlDocPtr pXmlDoc = parseExport("word/document.xml"); if (!pXmlDoc) return; -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1"); -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612"); -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checked", "val", "1"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:checkedState", "val", "2612"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w14:checkbox/w14:uncheckedState", "val", "2610"); // TODO: import control and add a check here } @@ -2664,7 +2664,7 @@ DECLARE_OOXMLEXPORT_TEST(testSdtContent, "SdtContent.docx") xmlDocPtr pXmlDoc = parseExport("word/header1.xml"); if (!pXmlDoc) return; -assertXPath(pXmlDoc, "/w:hdr[1]/w:p[1]/w:sdt[1]/w:sdtContent[1]/w:del[1]"); +assertXPath(pXmlDoc, "/w:hdr[1]/w:sdt[1]/w:sdtContent[1]/w:p[1]/w:del[1]"); } DECLARE_OOXMLEXPORT_TEST(testFdo76016, "fdo76016.docx") @@ -2749,8 +2749,8 @@ DECLARE_OOXMLEXPORT_TEST(testSimpleSdts, "simple-sdts.docx") if (!pXmlDoc) return; -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, "/w:document/w:body/w:sdt/w:sdtPr/w:text", 1); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:id", 3); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:picture", 1); assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:group", 1); assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:citation", 1); @@ -2797,8 +2797,8 @@ DECLARE_OOXMLEXPORT_TEST(testAuthorPropertySdt, "author-property.docx") if (!pXmlDoc) return; -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]"); -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "xpath", "/ns1:coreProperties[1]/ns0:creator[1]"); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtPr/w:dataBinding", "storeItemID","{6C3C8BC8-F283-45AE-878A-BAB7291924A1}"); // FIXME: the next property doesn't match, though it's correct in theory. A bug in assertXPath
[Libreoffice-commits] core.git: 2 commits - writerfilter/source
writerfilter/source/ooxml/OOXMLFactory.cxx |7 --- writerfilter/source/ooxml/OOXMLFactory.hxx |1 - writerfilter/source/ooxml/factory_ns.py |5 - writerfilter/source/ooxml/factoryimpl_ns.py | 14 -- writerfilter/source/ooxml/modelpreprocess.py |5 - 5 files changed, 32 deletions(-) New commits: commit 14a5f2f6fa3feabc8ef71843063b52364cbc4560 Author: Miklos Vajna Date: Tue Jul 29 19:04:19 2014 +0200 writerfilter: nobody reads enumname Change-Id: I4a5eb77ff14bb033061ce8214ef7f65d587b159a diff --git a/writerfilter/source/ooxml/modelpreprocess.py b/writerfilter/source/ooxml/modelpreprocess.py index 82e5e3f..cdb1382 100644 --- a/writerfilter/source/ooxml/modelpreprocess.py +++ b/writerfilter/source/ooxml/modelpreprocess.py @@ -136,11 +136,6 @@ def preprocess(model): localname = j.getAttribute("name") # set the attributes -enumname = "" -if len(prefix): -enumname += prefix + ":" -j.setAttribute("enumname", enumname + localname) - qname = "" if len(ns): qname += ns + ":" commit 423020de5d2533533aa0d19249079e1dcee632d2 Author: Miklos Vajna Date: Tue Jul 29 19:02:28 2014 +0200 writerfilter: unused OOXMLFactory_*::getName() Change-Id: I9cf482b10b719d40ab553616099d04c7b1572986 diff --git a/writerfilter/source/ooxml/OOXMLFactory.cxx b/writerfilter/source/ooxml/OOXMLFactory.cxx index 2e73930..afdadf1 100644 --- a/writerfilter/source/ooxml/OOXMLFactory.cxx +++ b/writerfilter/source/ooxml/OOXMLFactory.cxx @@ -279,13 +279,6 @@ void OOXMLFactory_ns::attributeAction(OOXMLFastContextHandler *, Token_t, OOXMLV { } -#ifdef DEBUG_DOMAINMAPPER -string OOXMLFactory_ns::getName() const -{ -return "noname"; -} -#endif - } } diff --git a/writerfilter/source/ooxml/OOXMLFactory.hxx b/writerfilter/source/ooxml/OOXMLFactory.hxx index 0150acb..76676ac 100644 --- a/writerfilter/source/ooxml/OOXMLFactory.hxx +++ b/writerfilter/source/ooxml/OOXMLFactory.hxx @@ -103,7 +103,6 @@ public: virtual void attributeAction(OOXMLFastContextHandler * pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue); #ifdef DEBUG_DOMAINMAPPER virtual string getDefineName(Id nId) const; -virtual string getName() const; #endif AttributeToResourceMapPointer getAttributeToResourceMap(Id nId); diff --git a/writerfilter/source/ooxml/factory_ns.py b/writerfilter/source/ooxml/factory_ns.py index edd0718..991d23a 100644 --- a/writerfilter/source/ooxml/factory_ns.py +++ b/writerfilter/source/ooxml/factory_ns.py @@ -56,11 +56,6 @@ public: print("""virtual void charactersAction(OOXMLFastContextHandler* pHandler, const OUString & sText); virtual void attributeAction(OOXMLFastContextHandler* pHandler, Token_t nToken, OOXMLValue::Pointer_t pValue); -#ifdef DEBUG_DOMAINMAPPER -virtual string getName() const; -#endif - - virtual ~OOXMLFactory_%s(); protected: diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py index 38ffa51..fc28dc2 100644 --- a/writerfilter/source/ooxml/factoryimpl_ns.py +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -636,19 +636,6 @@ def factoryAttributeAction(nsNode): print() -# factoryGetName - - -def factoryGetName(nsNode): -print("""#ifdef DEBUG_DOMAINMAPPER -string OOXMLFactory_%s::getName() const -{ -return "%s"; -} -#endif -""" % (nsToLabel(nsNode), nsNode.getAttribute("name"))) - - # createImpl @@ -692,7 +679,6 @@ namespace ooxml { factoryGetDefineName(nsNode) factoryTokenToIdMap(nsNode) factoryAttributeAction(nsNode) -factoryGetName(nsNode) print("""/// @endcond }}""") ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - writerfilter/source
writerfilter/source/dmapper/TablePropertiesHandler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0693b37fec987a8d443847d9b98d611def5ebfc1 Author: Miklos Vajna Date: Sat Mar 29 21:13:21 2014 +0100 coverity#1194911 Unchecked dynamic_cast Change-Id: I1e7f4bcd8f54219d86ad7a003469d5a486090f47 (cherry picked from commit 8736c5222a8e83a1310713a92492e63198749467) Reviewed-on: https://gerrit.libreoffice.org/10630 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx index b54b262..3aa4427 100644 --- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx +++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx @@ -97,7 +97,7 @@ namespace dmapper { DomainMapperTableManager* pManager = dynamic_cast(m_pTableManager); // In case any of the cells has the btLr cell direction, then an explicit minimal size will just hide the whole row, don't do that. -if (pMeasureHandler->GetRowHeightSizeType() != text::SizeType::MIN || !pManager->HasBtlrCell()) +if (pMeasureHandler->GetRowHeightSizeType() != text::SizeType::MIN || !pManager || !pManager->HasBtlrCell()) { // In case a cell already wanted fixed size, we should not overwrite it here. if (!pManager || !pManager->IsRowSizeTypeInserted()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper.cxx |9 - writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +++ writerfilter/source/dmapper/DomainMapper_Impl.hxx |6 +- writerfilter/source/dmapper/PropertyIds.cxx |1 + writerfilter/source/dmapper/PropertyIds.hxx |1 + 5 files changed, 26 insertions(+), 2 deletions(-) New commits: commit 864d018a1a806b9861739f10649076d758af07cb Author: Miklos Vajna Date: Wed Jul 30 21:42:01 2014 +0200 DOCX import: handle exact end of paragraph w:sdt tags Testcase will be added when the export half of this is also in place. Change-Id: Ic6ef8ea72a45424fcb5a473c74db9e30d6fd3be8 diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index b305afd..37af96b 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -932,7 +932,10 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) // It's not possible to insert the relevant property to the character context here: // the previous, already sent character context may be still active, so the property would be lost. -m_pImpl->setSdtEndDeferred(true); +if (m_pImpl->m_pSdtHelper->isOutsideAParagraph()) +m_pImpl->setParaSdtEndDeferred(true); +else +m_pImpl->setSdtEndDeferred(true); if (!m_pImpl->m_pSdtHelper->getDropDownItems().empty()) m_pImpl->m_pSdtHelper->createDropDownControl(); @@ -2607,10 +2610,14 @@ void DomainMapper::lcl_startParagraphGroup() m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, uno::makeAny( com::sun::star::style::BreakType_PAGE_BEFORE) ); else if (m_pImpl->isBreakDeferred(COLUMN_BREAK)) m_pImpl->GetTopContext()->Insert( PROP_BREAK_TYPE, uno::makeAny( com::sun::star::style::BreakType_COLUMN_BEFORE) ); + +if (m_pImpl->isParaSdtEndDeferred()) +m_pImpl->GetTopContext()->Insert(PROP_PARA_SDT_END_BEFORE, uno::makeAny(true), true, PARA_GRAB_BAG); } m_pImpl->SetIsFirstRun(true); m_pImpl->SetIsOutsideAParagraph(false); m_pImpl->clearDeferredBreaks(); +m_pImpl->setParaSdtEndDeferred(false); } void DomainMapper::lcl_endParagraphGroup() diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index dad72fa..2f5b441 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -165,6 +165,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_bIsColumnBreakDeferred( false ), m_bIsPageBreakDeferred( false ), m_bSdtEndDeferred(false), +m_bParaSdtEndDeferred(false), m_bStartTOC(false), m_bStartTOCHeaderFooter(false), m_bStartedTOC(false), @@ -721,6 +722,16 @@ bool DomainMapper_Impl::isSdtEndDeferred() return m_bSdtEndDeferred; } +void DomainMapper_Impl::setParaSdtEndDeferred(bool bParaSdtEndDeferred) +{ +m_bParaSdtEndDeferred = bParaSdtEndDeferred; +} + +bool DomainMapper_Impl::isParaSdtEndDeferred() +{ +return m_bParaSdtEndDeferred; +} + void lcl_MoveBorderPropertiesToFrame(comphelper::SequenceAsHashMap& rFrameProperties, uno::Reference const& xStartTextRange, uno::Reference const& xEndTextRange ) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 21c66af..e0d8259 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -331,8 +331,10 @@ private: bool m_bIsFirstSection; bool m_bIsColumnBreakDeferred; bool m_bIsPageBreakDeferred; -/// If we want to set "sdt end" on the next character contet. +/// If we want to set "sdt end" on the next character context. bool m_bSdtEndDeferred; +/// If we want to set "paragraph sdt end" on the next paragraph context. +bool m_bParaSdtEndDeferred; bool m_bStartTOC; bool m_bStartTOCHeaderFooter; /// If we got any text that is the pre-rendered result of the TOC field. @@ -505,6 +507,8 @@ public: void setSdtEndDeferred(bool bSdtEndDeferred); bool isSdtEndDe
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/ooxml/model.xml | 60 ++-- 1 file changed, 30 insertions(+), 30 deletions(-) New commits: commit 4131e8b63ba96ef3bc6a41daa6020262f6af5415 Author: Miklos Vajna Date: Wed Jul 30 21:59:26 2014 +0200 writerfilter: remove unused attributes They are confusing and not used in practice: modelpreprocess.py always sets the id to a numeric value anyway. Change-Id: I5bdfd001bc0fe7ee376e2fe27fefecc3613bd1ab diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 0a5881b..83c2b01 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -17,36 +17,36 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . --> http://relaxng.org/ns/structure/1.0";> - http://www.w3.org/XML/1998/namespace"; alias="xml" id="xml"/> - http://schemas.openxmlformats.org/officeDocument/2006/relationships"; alias="relationships" id="officeRel"/> - http://purl.oclc.org/ooxml/officeDocument/relationships"; alias="relationships" id="officeRel"/> - - http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"; alias="theme" id="officeRelTheme"/> - http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"; alias="wordprocessingDrawing" id="dmlWordDr"/> - http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing"; alias="wordprocessingDrawing" id="dmlWordDr"/> - http://schemas.openxmlformats.org/drawingml/2006/main"; alias="drawingml" id="dml"/> - http://purl.oclc.org/ooxml/drawingml/main"; alias="drawingml" id="dml"/> - - http://schemas.openxmlformats.org/drawingml/2006/picture"; alias="picture" id="dmlPicture"/> - http://purl.oclc.org/ooxml/drawingml/picture"; alias="picture" id="dmlPicture"/> - http://schemas.openxmlformats.org/drawingml/2006/diagram"; alias="diagram" id="dmlDiagram"/> - http://purl.oclc.org/ooxml/drawingml/diagram"; alias="diagram" id="dmlDiagram"/> - http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas"; alias="lockedCanvas" id="dmlLockedCanvas"/> - http://purl.oclc.org/ooxml/drawingml/lockedCanvas"; alias="lockedCanvas" id="dmlLockedCanvas"/> - http://schemas.microsoft.com/office/word/2010/wordprocessingShape"; alias="wps" id="wps"/> - http://schemas.microsoft.com/office/word/2010/wordprocessingGroup"; alias="wpg" id="wpg"/> - http://schemas.openxmlformats.org/drawingml/2006/chart"; alias="chart" id="dmlChart"/> - http://purl.oclc.org/ooxml/drawingml/chart"; alias="chart" id="dmlChart"/> - - http://schemas.openxmlformats.org/wordprocessingml/2006/main"; alias="wordprocessingml" id="doc"/> - http://purl.oclc.org/ooxml/wordprocessingml/main"; alias="wordprocessingml" id="doc"/> - http://schemas.openxmlformats.org/officeDocument/2006/math"; alias="math" id="officeMath"/> - http://purl.oclc.org/ooxml/officeDocument/math"; alias="math" id="officeMath"/> - http://schemas.openxmlformats.org/schemaLibrary/2006/main"; alias="schemaLibrary" id="schema"/> - http://schemas.openxmlformats.org/markup-compatibility/2006"; alias="mce" id="mce"/> - http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing"; alias="wp14" id="wp14"/> - http://schemas.microsoft.com/office/word/2010/wordml"; alias="w14" id="w14"/> - http://schemas.microsoft.com/office/drawing/2010/main"; alias="a14" id="a14"/> + http://www.w3.org/XML/1998/namespace"; alias="xml"/> + http://schemas.openxmlformats.org/officeDocument/2006/relationships"; alias="relationships"/> + http://purl.oclc.org/ooxml/officeDocument/relationships"; alias="relationships"/> + + http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"; alias="theme"/> + http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing"; alias="wordprocessingDrawing"/> + http://purl.oclc.org/ooxml/drawingml/wordprocessingDrawing"; alias="wordprocessingDrawing"/> + http://schemas.openxmlformats.org/drawingml/2006/main"; alias="drawingml"/> + http://purl.oclc.org/ooxml/drawingml/main"; alias="drawingml"/&g
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/sdt-2-para.docx |binary sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx | 28 + sw/source/filter/ww8/docxattributeoutput.cxx | 55 +- sw/source/filter/ww8/docxattributeoutput.hxx |8 +++ sw/source/filter/ww8/docxexport.cxx |7 +++ sw/source/filter/ww8/docxexport.hxx |3 + sw/source/filter/ww8/docxsdrexport.cxx| 23 ++ sw/source/filter/ww8/docxsdrexport.hxx|5 ++ 8 files changed, 119 insertions(+), 10 deletions(-) New commits: commit 4a39475e355b256dc0a922d21b21e695aaa5577b Author: Miklos Vajna Date: Thu Jul 31 09:36:32 2014 +0200 DOCX export: handle exact end of paragraph w:sdt tags Previously every paragraph SDT was closed immediately after the paragraph end. This commit adds support for having multiple paragraphs inside an SDT. A few testcases implicitly tested that such SDT's are lost on save, adjust the relevant XPath expressions now that this works. Change-Id: I07802b3e067600b087b7e0f9b2e7b3ba17c3379a diff --git a/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx b/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx new file mode 100644 index 000..b6d6565 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-2-para.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 9b4b380..76cb592 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -126,7 +126,7 @@ DECLARE_OOXMLEXPORT_TEST(testHyperlineIsEnd, "hyperlink.docx") // If document.xml miss any ending tag then parseExport() returns NULL which fail the test case. CPPUNIT_ASSERT(pXmlDoc) ; // Check hyperlink is properly open. -assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:hyperlink",1); +assertXPath(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:hyperlink",1); } DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") @@ -136,7 +136,7 @@ DECLARE_OOXMLEXPORT_TEST(testFdo69649, "fdo69649.docx") if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[21]/w:hyperlink/w:r[5]/w:t", "15"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[21]/w:hyperlink/w:r[5]/w:t", "15"); } DECLARE_OOXMLEXPORT_TEST(testFieldFlagO,"TOC_field_f.docx") @@ -183,7 +183,7 @@ DECLARE_OOXMLEXPORT_TEST(testPreserveWfieldTOC, "PreserveWfieldTOC.docx") if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " TOC \\z \\w \\f \\o \"1-3\" \\h"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\w \\f \\o \"1-3\" \\h"); } DECLARE_OOXMLEXPORT_TEST(testFieldFlagB,"TOC_field_b.docx") @@ -204,7 +204,7 @@ DECLARE_OOXMLEXPORT_TEST(testPreserveXfieldTOC, "PreserveXfieldTOC.docx") if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\x \\f \\o \"1-3\" \\h"); } DECLARE_OOXMLEXPORT_TEST(testFDO77715,"FDO77715.docx") @@ -225,7 +225,7 @@ DECLARE_OOXMLEXPORT_TEST(testTOCFlag_u,"testTOCFlag_u.docx") // FIXME "p[2]" will have to be "p[1]", once the TOC import code is fixed // not to insert an empty paragraph before TOC. -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:instrText", " TOC \\z \\o \"1-9\" \\u \\h"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p/w:r[2]/w:instrText", " TOC \\z \\o \"1-9\" \\u \\h"); } DECLARE_OOXMLEXPORT_TEST(testfdo73596_RunInStyle,"fdo73596_RunInStyle.docx") @@ -337,7 +337,7 @@ DECLARE_OOXMLEXPORT_TEST(testPageref, "testPageref.docx") if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p[1]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h"); +assertXPathContent(pXmlDoc, "/w:document/w:body/w:sdt/w:sdtContent/w:p[2]/w:hyperlink/w:r[3]/w:instrText", "PAGEREF _Toc355095261 \\h"); } DECLARE_OOXMLEXPORT_TEST(testAlphabeticalIndex_AutoColumn,"alphabeticalIndex_AutoColumn.docx") @@ -375,7 +375,7 @@ DECLARE_OOXMLEXPORT_TEST(testBibliography,"FDO75133.docx") if (!pXmlDoc) return; -assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:ins
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/ooxmlexport/data/2-id.docx |binary sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |9 + sw/source/filter/ww8/docxattributeoutput.cxx |2 +- 3 files changed, 10 insertions(+), 1 deletion(-) New commits: commit 48f52a509aeed8c8a780bf07d3761a7699e8a36b Author: Miklos Vajna Date: Thu Jul 31 10:50:44 2014 +0200 DocxAttributeOutput::WriteSdtBlock: never write twice Change-Id: Iab68a4e809a7924e753db5a85d9914308419b845 diff --git a/sw/qa/extras/ooxmlexport/data/2-id.docx b/sw/qa/extras/ooxmlexport/data/2-id.docx new file mode 100644 index 000..6d05e68 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/2-id.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 76cb592..1e0b98d 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -532,6 +532,15 @@ DECLARE_OOXMLEXPORT_TEST(testSdt2Run, "sdt-2-para.docx") } } +DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx") +{ +if (xmlDocPtr pXmlDoc = parseExport()) +{ +// This was 2, but only one w:id is allowed. +assertXPath(pXmlDoc, "//w:sdtPr/w:id", 1); +} +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 9078f8b..c66a6ea 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -612,7 +612,7 @@ void DocxAttributeOutput::WriteSdtBlock( sal_Int32& nSdtPrToken, m_pSerializer->endElement( nSdtPrToken ); } -else if( (nSdtPrToken > 0) && !(m_bRunTextIsOn && m_rExport.SdrExporter().IsParagraphHasDrawing())) +else if( (nSdtPrToken > 0) && nSdtPrToken != FSNS( XML_w, XML_id ) && !(m_bRunTextIsOn && m_rExport.SdrExporter().IsParagraphHasDrawing())) m_pSerializer->singleElement( nSdtPrToken, FSEND ); if( nSdtPrToken == FSNS( XML_w, XML_id ) || ( bPara && m_bParagraphSdtHasId ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx |binary sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx|9 + writerfilter/source/dmapper/DomainMapper.cxx |6 ++ 3 files changed, 15 insertions(+) New commits: commit ddb24728b2971f6ed64a0372acb166251f1d9c8f Author: Miklos Vajna Date: Thu Jul 31 15:45:31 2014 +0200 DOCX import: merging properties of different SDT's are not wanted When the document starts with a table and both the A1 cell as well as the document start has an SDT start, then we see both at the same time when we check for pending SDT's in lcl_utext(). This leads to merging the properties of the two SDT's, which is clearly not wanted. Fix the problem by clearning the SDT property list when we see a start of a new property list: that produces a valid document. Change-Id: I8fbe7bec02beebb26ed99fa7b08bc62225bff50c diff --git a/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx new file mode 100644 index 000..d3bf3bc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-start-2-sdt.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 1e0b98d..73fab54 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -541,6 +541,15 @@ DECLARE_OOXMLEXPORT_TEST(test2Id, "2-id.docx") } } +DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx") +{ +if (xmlDocPtr pXmlDoc = parseExport()) +{ +// w:docPartGallery should be a child of , make sure it's not a child of w:text. +assertXPath(pXmlDoc, "//w:sdt/w:sdtPr/w:text/w:docPartGallery", 0); +} +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 37af96b..c9973c2 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2451,6 +2451,12 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext ) } } break; +case NS_ooxml::LN_CT_SdtPr_rPr: +{ +// Make sure properties from a pervious SDT are not merged with the current ones. +m_pImpl->m_pSdtHelper->getInteropGrabBagAndClear(); +} +break; default: { #ifdef DEBUG_DOMAINMAPPER ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx |binary sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx |9 + writerfilter/source/dmapper/SdtHelper.cxx |2 ++ 3 files changed, 11 insertions(+) New commits: commit 8fea536cebefe319a7fd5971b28e0936ac91ecb9 Author: Miklos Vajna Date: Thu Jul 31 17:20:43 2014 +0200 SdtHelper::createDateControl: clear the property list after reading it Otherwise it may happen that the property list will be read twice, and on export we'll create two for a single imported one. Change-Id: I57ab595f956c5e808fc73fe644ee3e249a1fc1ed diff --git a/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx b/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx new file mode 100644 index 000..038ab11 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/sdt-date-duplicate.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx index 73fab54..2e5844a 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx @@ -550,6 +550,15 @@ DECLARE_OOXMLEXPORT_TEST(testTableStart2Sdt, "table-start-2-sdt.docx") } } +DECLARE_OOXMLEXPORT_TEST(testSdtDateDuplicate, "sdt-date-duplicate.docx") +{ +if (xmlDocPtr pXmlDoc = parseExport()) +{ +// Single was exported as 2 elements. +assertXPath(pXmlDoc, "//w:sdt", 1); +} +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/SdtHelper.cxx b/writerfilter/source/dmapper/SdtHelper.cxx index bf268a3..693b248 100644 --- a/writerfilter/source/dmapper/SdtHelper.cxx +++ b/writerfilter/source/dmapper/SdtHelper.cxx @@ -131,6 +131,8 @@ void SdtHelper::createDateControl(OUString& rContentText, beans::PropertyValue a aGrabBag["CharFormat"] <<= aCharFormat.Value; // merge in properties like ooxml:CT_SdtPr_alias and friends. aGrabBag.update(comphelper::SequenceAsHashMap(m_aGrabBag)); +// and empty the property list, so they won't end up on the next sdt as well +m_aGrabBag.realloc(0); std::vector aItems; createControlShape(lcl_getOptimalWidth(m_rDM_Impl.GetStyleSheetTable(), rContentText, aItems), xControlModel, aGrabBag.getAsConstPropertyValueList()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/ooxml/factoryimpl_ns.py |2 +- writerfilter/source/ooxml/model.xml | 19 --- 2 files changed, 1 insertion(+), 20 deletions(-) New commits: commit 17f8a0d05fb7523e3ebc6f0179c227b1c050389c Author: Miklos Vajna Date: Fri Aug 1 09:20:23 2014 +0200 writerfilter: fail on non-existing includes Also remove all such includes that did nothing so far. Hopefully if the script fails on it early, that helps detecting typos during development. Change-Id: I56bcf16263b7556bc237aceeb2041dfcfb3e02fa diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py index fc28dc2..687814d 100644 --- a/writerfilter/source/ooxml/factoryimpl_ns.py +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -226,7 +226,7 @@ def contextResource(files, nsNode, refNode): for resourceNode in [i for i in getChildrenByName(nsNode, "resource") if i.getAttribute("name") == refName]: return resourceNode.getAttribute("resource") -for includeNode in [i for i in getChildrenByName(getChildByName(nsNode, "grammar"), "include") if i.getAttribute("href") in files]: +for includeNode in getChildrenByName(getChildByName(nsNode, "grammar"), "include"): namespaceNode = files[includeNode.getAttribute("href")] for resourceNode in [i for i in getChildrenByName(namespaceNode, "resource") if i.getAttribute("name") == refName]: return resourceNode.getAttribute("resource") diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 83c2b01..52993a9 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -82,7 +82,6 @@ http://schemas.openxmlformats.org/officeDocument/2006/relationships"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> - @@ -274,8 +273,6 @@ http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main";> - - @@ -323,8 +320,6 @@ http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main";> - - Light Rig Direction @@ -470,7 +465,6 @@ - @@ -689,8 +683,6 @@ http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main";> - - Preset Camera Type @@ -1248,7 +1240,6 @@ http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> - @@ -1657,8 +1648,6 @@ http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> - - @@ -4801,7 +4790,6 @@ http://schemas.openxmlformats.org/drawingml/2006/main"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> - @@ -7206,8 +7194,6 @@ http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-function
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |6 +- writerfilter/source/ooxml/OOXMLFastContextHandler.hxx |2 +- writerfilter/source/ooxml/factoryimpl_ns.py |2 -- writerfilter/source/ooxml/model.xml |2 +- 4 files changed, 3 insertions(+), 9 deletions(-) New commits: commit b92e9f45442b109d743a620775e1691b45d1e831 Author: Miklos Vajna Date: Fri Aug 1 10:57:07 2014 +0200 clean up unused OOXMLFastContextHandler::fldData parameter Change-Id: I6af797257c6e6e7bd95597ab786660fd9ade06a0 diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index 6b31599..09af955 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -745,12 +745,8 @@ void OOXMLFastContextHandler::positionOffset(const OUString & sText) ::writerfilter::dmapper::PositionHandler::setPositionOffset( sText, inPositionV ); } -void OOXMLFastContextHandler::fldData(const OUString & /* sText */) +void OOXMLFastContextHandler::ignore() { -// ignore --- As per ECMA fldData has been removed. -// WordprocessingML Page# 5011 [ ISO/IEC 29500-1:2012 ] -// WordprocessingML Page# 5552 [ ECMA-376 Part 1 ] -// Hack, so that fldData is not interpreted as field Command } void OOXMLFastContextHandler::alignH(const OUString & sText) diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx index 221c222b..c186159 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.hxx @@ -195,7 +195,7 @@ public: void endOfParagraph(); void text(const OUString & sText); void positionOffset(const OUString & sText); -void fldData(const OUString & sText); +void ignore(); void alignH(const OUString & sText); void alignV(const OUString & sText); void positivePercentage(const OUString& rText); diff --git a/writerfilter/source/ooxml/factoryimpl_ns.py b/writerfilter/source/ooxml/factoryimpl_ns.py index bc59480..687814d 100644 --- a/writerfilter/source/ooxml/factoryimpl_ns.py +++ b/writerfilter/source/ooxml/factoryimpl_ns.py @@ -400,8 +400,6 @@ def factoryChooseAction(actionNode): ret.append("pHandler->alignH(sText);") elif actionNode.getAttribute("action") == "alignV": ret.append("pHandler->alignV(sText);") -elif actionNode.getAttribute("action") == "fldData": -ret.append("pHandler->fldData(sText);") elif actionNode.getAttribute("action") == "tokenproperty": ret.append(" OOXMLFastHelper::newProperty(pHandler, %s, pHandler->getToken());" % idToLabel("ooxml:token")) else: diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index ea9fc78..3ff9450 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -24448,7 +24448,7 @@ - + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/core/text/frmpaint.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0fd4cc8ba7335e33515413f54b19455b376d5db9 Author: Miklos Vajna Date: Thu May 8 18:49:11 2014 +0200 fdo#78444 sw: avoid incorrect right shrinking of repaint rectangle The old condition was: set the right edge of the repaint rectangle, in case the result would be wider than the original (if we repaint more, that can't hurt regarding the end result) or in case the left edge was set. But that's problematic, the reproducer situation described in the bug triggers a case when the right edge is shrunk too much, so part of the painted letter is missing. Fix that by only setting the right edge of the repaint rectangle when we know that it won't shrink. Change-Id: I33b78a929021b284d5283fc2c35e0b3c999fa224 diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index fb41bab..69eb302 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -432,7 +432,7 @@ SwRect SwTxtFrm::Paint() pRepaint->Left( pRepaint->GetOfst() ); l = pRepaint->GetRightOfst(); -if( l && ( pRepaint->GetOfst() || l > pRepaint->Right() ) ) +if( l && l > pRepaint->Right() ) pRepaint->Right( l ); pRepaint->SetOfst( 0 ); aRet = *pRepaint; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/qa
sw/qa/extras/ooxmlexport/data/fdo71834.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx|2 +- 2 files changed, 1 insertion(+), 1 deletion(-) New commits: commit d5874376a7db53a4b0e8b3fabb902d14639032cc Author: Miklos Vajna Date: Fri May 9 08:40:10 2014 +0200 fdo#71834 make reproducer document more minimal 1,5M -> 21K without loosing anything interesting. Change-Id: I145612b9242dd6570e0b4e90f85171b177214500 diff --git a/sw/qa/extras/ooxmlexport/data/fdo71834.docx b/sw/qa/extras/ooxmlexport/data/fdo71834.docx index 62262d9..1545334 100644 Binary files a/sw/qa/extras/ooxmlexport/data/fdo71834.docx and b/sw/qa/extras/ooxmlexport/data/fdo71834.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 42e25c7..4f0a329 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2181,7 +2181,7 @@ DECLARE_OOXMLEXPORT_TEST(testFDO71834, "fdo71834.docx") xmlDocPtr pXmlDoc = parseExport("word/document.xml"); if (!pXmlDoc) return; -assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[4]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa"); +assertXPath(pXmlDoc, "/w:document/w:body/w:tbl[1]/w:tr[2]/w:tc[1]/w:tcPr[1]/w:tcW[1]","type", "dxa"); } DECLARE_OOXMLEXPORT_TEST(testFieldFlagO,"TOC_field_f.docx") ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/source
sc/source/core/tool/address.cxx |4 ++-- sc/source/core/tool/chgtrack.cxx |6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) New commits: commit a7e8e0f29e499e500d33e1f43d73b6f233919e93 Author: Miklos Vajna Date: Sat May 10 07:34:02 2014 +0200 -Werror=parentheses Change-Id: I2366a8631be276db02392db6b44ee0c47ddf9da6 diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index d1ea155..7554b92 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -615,7 +615,7 @@ static const sal_Unicode* lcl_r1c1_get_col( const sal_Unicode* p, return NULL; p++; -if( isRelative = (*p == '[') ) +if( ( isRelative = (*p == '[') ) ) p++; n = sal_Unicode_strtol( p, &pEnd ); if( NULL == pEnd ) @@ -661,7 +661,7 @@ static inline const sal_Unicode* lcl_r1c1_get_row( return NULL; p++; -if( isRelative = (*p == '[') ) +if( ( isRelative = (*p == '[') ) ) p++; n = sal_Unicode_strtol( p, &pEnd ); if( NULL == pEnd ) diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index f6def98..b9cc58a 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1018,12 +1018,12 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc ) case SC_CAT_DELETE_COLS : if ( !(aRange.aStart.Col() == 0 && aRange.aEnd.Col() == MAXCOL) ) { // Only if not TabDelete -if ( bOk = pDoc->CanInsertCol( aRange ) ) +if ( ( bOk = pDoc->CanInsertCol( aRange ) ) ) bOk = pDoc->InsertCol( aRange ); } break; case SC_CAT_DELETE_ROWS : -if ( bOk = pDoc->CanInsertRow( aRange ) ) +if ( ( bOk = pDoc->CanInsertRow( aRange ) ) ) bOk = pDoc->InsertRow( aRange ); break; case SC_CAT_DELETE_TABS : @@ -1031,7 +1031,7 @@ bool ScChangeActionDel::Reject( ScDocument* pDoc ) //TODO: Remember table names? OUString aName; pDoc->CreateValidTabName( aName ); -if ( bOk = pDoc->ValidNewTabName( aName ) ) +if ( ( bOk = pDoc->ValidNewTabName( aName ) ) ) bOk = pDoc->InsertTab( aRange.aStart.Tab(), aName ); } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svtools
include/svtools/langtab.hxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 79a4d09ac2e5daaad29c10b39d34ff0f09d1d9ad Author: Miklos Vajna Date: Sat May 10 07:38:00 2014 +0200 ISO C++ forbids declaration of ârLanguageTagâ with no type Change-Id: I148b3eff0fc229fec3c6415bd582d10b124e0796 diff --git a/include/svtools/langtab.hxx b/include/svtools/langtab.hxx index f8e6363..0034873 100644 --- a/include/svtools/langtab.hxx +++ b/include/svtools/langtab.hxx @@ -23,6 +23,8 @@ #include #include +class LanguageTag; + class SVT_DLLPUBLIC SvtLanguageTable { public: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - svx/source sw/source
svx/source/svdraw/svdoashp.cxx| 19 - sw/source/core/doc/docbm.cxx |9 sw/source/filter/ww8/rtfsdrexport.cxx | 565 +- sw/source/filter/ww8/rtfsdrexport.hxx | 26 - 4 files changed, 315 insertions(+), 304 deletions(-) New commits: commit 1a4d24b3a430ed7f75e76e64fb0e22d05a1fad0d Author: Miklos Vajna Date: Sun May 11 18:24:44 2014 +0200 sw: fix indentation in rtfsdrexport Change-Id: I5499007c88659b2d235c765ba352e2bc4a8a3eb8 diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index c64629c..34fa98e 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -33,18 +33,18 @@ using namespace sw::util; using namespace css; -RtfSdrExport::RtfSdrExport( RtfExport &rExport ) -: EscherEx( EscherExGlobalRef( new EscherExGlobal ), 0 ), - m_rExport( rExport ), - m_rAttrOutput( (RtfAttributeOutput&)m_rExport.AttrOutput() ), - m_pSdrObject( NULL ), - m_nShapeType( ESCHER_ShpInst_Nil ), - m_nShapeFlags ( 0 ) , - m_pShapeStyle( new OStringBuffer( 200 ) ), - m_pShapeTypeWritten( new bool[ ESCHER_ShpInst_COUNT ] ) +RtfSdrExport::RtfSdrExport(RtfExport& rExport) +: EscherEx(EscherExGlobalRef(new EscherExGlobal), 0), + m_rExport(rExport), + m_rAttrOutput((RtfAttributeOutput&)m_rExport.AttrOutput()), + m_pSdrObject(NULL), + m_nShapeType(ESCHER_ShpInst_Nil), + m_nShapeFlags(0) , + m_pShapeStyle(new OStringBuffer(200)), + m_pShapeTypeWritten(new bool[ ESCHER_ShpInst_COUNT ]) { mnGroupLevel = 1; -memset( m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof( bool ) ); +memset(m_pShapeTypeWritten, 0, ESCHER_ShpInst_COUNT * sizeof(bool)); } RtfSdrExport::~RtfSdrExport() @@ -54,18 +54,18 @@ RtfSdrExport::~RtfSdrExport() delete[] m_pShapeTypeWritten, m_pShapeTypeWritten = NULL; } -void RtfSdrExport::OpenContainer( sal_uInt16 nEscherContainer, int nRecInstance ) +void RtfSdrExport::OpenContainer(sal_uInt16 nEscherContainer, int nRecInstance) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); -EscherEx::OpenContainer( nEscherContainer, nRecInstance ); +EscherEx::OpenContainer(nEscherContainer, nRecInstance); -if ( nEscherContainer == ESCHER_SpContainer ) +if (nEscherContainer == ESCHER_SpContainer) { m_nShapeType = ESCHER_ShpInst_Nil; -if ( !m_pShapeStyle->isEmpty() ) +if (!m_pShapeStyle->isEmpty()) m_pShapeStyle->makeStringAndClear(); -m_pShapeStyle->ensureCapacity( 200 ); +m_pShapeStyle->ensureCapacity(200); m_aShapeProps.clear(); } } @@ -74,11 +74,11 @@ void RtfSdrExport::CloseContainer() { SAL_INFO("sw.rtf", OSL_THIS_FUNC); -if ( mRecTypes.back() == ESCHER_SpContainer ) +if (mRecTypes.back() == ESCHER_SpContainer) { // write the shape now when we have all the info sal_Int32 nShapeElement = StartShape(); -EndShape( nShapeElement ); +EndShape(nShapeElement); // cleanup m_nShapeType = ESCHER_ShpInst_Nil; @@ -87,7 +87,7 @@ void RtfSdrExport::CloseContainer() EscherEx::CloseContainer(); } -sal_uInt32 RtfSdrExport::EnterGroup( const OUString& /*rShapeName*/, const Rectangle* /*pRect*/ ) +sal_uInt32 RtfSdrExport::EnterGroup(const OUString& /*rShapeName*/, const Rectangle* /*pRect*/) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); @@ -101,7 +101,7 @@ void RtfSdrExport::LeaveGroup() /* noop */ } -void RtfSdrExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 /*nShapeId*/ ) +void RtfSdrExport::AddShape(sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_uInt32 /*nShapeId*/) { SAL_INFO("sw.rtf", OSL_THIS_FUNC); @@ -109,30 +109,30 @@ void RtfSdrExport::AddShape( sal_uInt32 nShapeType, sal_uInt32 nShapeFlags, sal_ m_nShapeFlags = nShapeFlags; } -inline sal_uInt16 impl_GetUInt16( const sal_uInt8* &pVal ) +inline sal_uInt16 impl_GetUInt16(const sal_uInt8*& pVal) { sal_uInt16 nRet = *pVal++; -nRet += ( *pVal++ ) << 8; +nRet += (*pVal++) << 8; return nRet; } -inline sal_Int32 impl_GetPointComponent( const sal_uInt8* &pVal, sal_Size& rVerticesPos, sal_uInt16 nPointSize ) +inline sal_Int32 impl_GetPointComponent(const sal_uInt8*& pVal, sal_Size& rVerticesPos, sal_uInt16 nPointSize) { sal_Int32 nRet = 0; -if ( ( nPointSize == 0xfff0 ) || ( nPointSize == 4 ) ) +if ((nPointSize == 0xfff0) || (nPointSize == 4)) { sal_uInt16 nUnsigned = *pVal++; -nUnsigned += ( *pVal++ ) << 8; +nUnsigned += (*pVal++) << 8; rVerticesPos += 2; -nRet = sal_Int16( nUnsigned ); +nRet = sal_Int16(nUnsigned); } -else if ( nPointSize == 8 ) +else if (nPointSize == 8)
[Libreoffice-commits] core.git: 3 commits - writerfilter/source
writerfilter/source/dmapper/CellColorHandler.cxx |2 -- writerfilter/source/dmapper/ConversionHelper.cxx |3 +-- writerfilter/source/dmapper/DomainMapper.cxx |1 - writerfilter/source/rtftok/rtfdocumentimpl.cxx |2 -- 4 files changed, 1 insertion(+), 7 deletions(-) New commits: commit be267ff6338ba023a7230a41c92186b844bdd396 Author: Miklos Vajna Date: Mon May 12 10:16:27 2014 +0200 writerfilter: write out table::BorderLineStyle::NONE Change-Id: Ifc9e42f12c8e3d6ae1f98396fddf5bd6adcf3ba1 diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index bff0e82..af6ea70 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -31,7 +31,6 @@ #include using namespace com::sun::star; -using namespace com::sun::star::table::BorderLineStyle; namespace writerfilter { namespace dmapper{ @@ -85,7 +84,7 @@ void MakeBorderLine( sal_Int32 nLineThickness, sal_Int32 nLineType, ::editeng::SvxBorderStyle const nLineStyle( ::editeng::ConvertBorderStyleFromWord(nLineType)); rToFill.LineStyle = nLineStyle; -double const fConverted( (NONE == nLineStyle) ? 0.0 : +double const fConverted( (table::BorderLineStyle::NONE == nLineStyle) ? 0.0 : ::editeng::ConvertBorderWidthFromWord(nLineStyle, nLineThickness, nLineType)); rToFill.LineWidth = convertTwipToMM100(fConverted); commit 9655f94bb4f778e5dede0d8d45e001d1cc24275a Author: Miklos Vajna Date: Mon May 12 10:15:37 2014 +0200 writerfilter: unused 'using' in dmapper Change-Id: Id6a8362872bb4602b840da388189fecc046dd97e diff --git a/writerfilter/source/dmapper/CellColorHandler.cxx b/writerfilter/source/dmapper/CellColorHandler.cxx index c70936d..c069b4b 100644 --- a/writerfilter/source/dmapper/CellColorHandler.cxx +++ b/writerfilter/source/dmapper/CellColorHandler.cxx @@ -30,8 +30,6 @@ namespace writerfilter { namespace dmapper { using namespace ::com::sun::star::drawing; -using namespace ::writerfilter; - CellColorHandler::CellColorHandler() : LoggedProperties(dmapper_logger, "CellColorHandler"), diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index e50ccf4..dd92026 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -70,7 +70,6 @@ #include using namespace ::com::sun::star; -using namespace ::rtl; namespace writerfilter { commit 2c95e104e942408948bb1134310884ab66a68a6c Author: Miklos Vajna Date: Mon May 12 10:12:06 2014 +0200 writerfilter: unused 'using' in rtftok Change-Id: Ie28d898d490ff695143e9f09502fa10db092ccc7 diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 38e8653..f62827e 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -59,8 +59,6 @@ #define MM100_TO_EMU(MM100) (MM100 * 360) -using std::make_pair; - namespace writerfilter { namespace rtftok ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/core/text/frmpaint.cxx |8 1 file changed, 8 insertions(+) New commits: commit f7b88a2b03122360b2e60e2afa453603022d28df Author: Miklos Vajna Date: Mon May 12 17:11:37 2014 +0200 fdo#78608 SwTxtFrm::Paint: fix missing repaint problem on the left edge Change-Id: Iba66a82e4a92a0afe1ad923cf4e0922730bd03de diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 69eb302..112c148 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -437,6 +437,14 @@ SwRect SwTxtFrm::Paint() pRepaint->SetOfst( 0 ); aRet = *pRepaint; +// In case our left edge is the same as the body frame's left edge, +// then extend the rectangle to include the page margin as well, +// otherwise some font will be clipped. +SwLayoutFrm* pBodyFrm = GetUpper(); +if (pBodyFrm->IsBodyFrm() && aRet.Left() == (pBodyFrm->Frm().Left() + pBodyFrm->Prt().Left())) +if (SwLayoutFrm* pPageFrm = pBodyFrm->GetUpper()) +aRet.Left(pPageFrm->Frm().Left()); + if ( IsRightToLeft() ) SwitchLTRtoRTL( aRet ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/docxattributeoutput.cxx |2 +- sw/source/filter/ww8/docxattributeoutput.hxx |2 +- sw/source/filter/ww8/docxexport.cxx |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit ac9f7c8d1abffe882093f93ea70dc5e31d28a7a2 Author: Miklos Vajna Date: Tue May 13 10:19:25 2014 +0200 DocxAttributeOutput: ClearGraphicCache() -> ClearRelIdCache() Because rel ids are used not only for graphics. Change-Id: I9d0fd7196a1b8e0494d850197cb50fc8098eff82 diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c84d2e6..2d30749 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3567,7 +3567,7 @@ void DocxAttributeOutput::WriteSrcRect(const SdrObject* pSdrObj ) } } -void DocxAttributeOutput::ClearGraphicCache() +void DocxAttributeOutput::ClearRelIdCache() { m_aRelIdCache.clear(); } diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx index 81305ba..c5dac2d 100644 --- a/sw/source/filter/ww8/docxattributeoutput.hxx +++ b/sw/source/filter/ww8/docxattributeoutput.hxx @@ -358,7 +358,7 @@ public: void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds ); void WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds ); -void ClearGraphicCache(); +void ClearRelIdCache(); private: /// Initialize the structures where we are going to collect some of the paragraph properties. diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index f8500e4..28db5ec 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -713,7 +713,7 @@ void DocxExport::WriteHeaderFooter( const SwFmt& rFmt, bool bHeader, const char* //When the stream changes the cache which is maintained for the graphics in case of alternate content is not cleared. //So clearing the alternate content graphic cache. -m_pAttrOutput->ClearGraphicCache(); +m_pAttrOutput->ClearRelIdCache(); // switch the serializer back m_pAttrOutput->SetSerializer( m_pDocumentFS ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/GraphicImport.cxx |1 writerfilter/source/ooxml/model.xml | 33 -- 2 files changed, 27 insertions(+), 7 deletions(-) New commits: commit 701f3dcb8d647304c56e7c437cc942b908123bc3 Author: Miklos Vajna Date: Tue May 13 16:00:44 2014 +0200 fdo#78657 writerfilter: tokenize a:hlinkClick This is just the tokenizer part, though all the heavy-lifing in model.xml should be now done. Change-Id: I42a13637a29411d4ee8925d7f06336584d69f25a diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index a145905..10c7029 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -933,6 +933,7 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_wpg_wgp: case NS_ooxml::LN_sizeRelH_sizeRelH: case NS_ooxml::LN_sizeRelV_sizeRelV: +case NS_ooxml::LN_hlinkClick_hlinkClick: { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml index 3fb84af..203d20a 100644 --- a/writerfilter/source/ooxml/model.xml +++ b/writerfilter/source/ooxml/model.xml @@ -78,11 +78,12 @@ -http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> + +http://schemas.openxmlformats.org/officeDocument/2006/relationships"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> - + @@ -228,6 +229,13 @@ + + + + + + + @@ -243,13 +251,24 @@ + + + + + +http://schemas.openxmlformats.org/officeDocument/2006/relationships"; name="CT_Hyperlink" resource="Properties" tag="shape"> + + + + + http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main";> @@ -4780,7 +4799,7 @@ -http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> +http://schemas.openxmlformats.org/drawingml/2006/main"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:fn="http://www.w3.org/2006/xpath-functions"; xmlns="http://relaxng.org/ns/structure/1.0"; ns="http://schemas.openxmlformats.org/drawingml/2006/main"; datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";> @@ -5027,8 +5046,8 @@ - - + + @@ -5177,8 +5196,8 @@ - - +http://schemas.openxmlformats.org/drawingml/2006/main"; name="CT_NonVisualDrawingProps" resource="Properties" tag="shape"> + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper_Impl.cxx |2 +- writerfilter/source/dmapper/DomainMapper_Impl.hxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 671eb12dee290607ed66f3b325f28e7bd4695cba Author: Miklos Vajna Date: Wed May 14 09:54:22 2014 +0200 writerfilter: DomainMapper_Impl::SetSymbolData() should take an int One wonders how did this work so far. Change-Id: I6aee6a2f7e15c1c4931ca5d65b6ad39d025ff9ed diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index bb81d09..bfeb770 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -376,7 +376,7 @@ void DomainMapper_Impl::RemoveLastParagraph( ) } } -void DomainMapper_Impl::SetSymbolData( bool nSymbolData ) +void DomainMapper_Impl::SetSymbolData( sal_Int32 nSymbolData ) { m_nSymboldata = nSymbolData; } diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 0c1178a..5b17baf 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -468,7 +468,7 @@ public: void SetParaSectpr(bool bParaSectpr); bool GetParaSectpr(); -void SetSymbolData( bool nSymbolData ); +void SetSymbolData( sal_Int32 nSymbolData ); sal_Int32 GetSymbolData(); /// Setter method for m_bSdt. void SetSdt(bool bSdt); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Changes to 'feature/textbox'
New branch 'feature/textbox' available with the following commits: commit e939daf25b2b2b8a5fd66ba78bc792a5dcb2f0b2 Author: Miklos Vajna Date: Wed May 14 11:52:33 2014 +0200 SwXShape: new bool TextBox property Change-Id: Id9744db2d2a7c6102514f05109c80650af243e28 commit 31f26e74bd249c9ab93f485b28ab9af7b29a3b36 Author: Miklos Vajna Date: Wed May 14 11:44:35 2014 +0200 SwXShape: invoke SwTextBoxHelper For now, only in queryInterface(), setPropertyValue() and setSize(). It's safe to always call these methods, if they are not relevant, the method will be a NOP. Change-Id: I1985f8bcac38cf232652a1e30241a5fa6bef5aba commit 0c6932a8c79c455c57270fc9203d1041d1a26574 Author: Miklos Vajna Date: Wed May 14 11:41:19 2014 +0200 Initial SwTextBoxHelper Change-Id: I928cf7d7cbfb62ffa98be9412d7425a6dc61bfdb commit a9c5d2e2112d693c00e2c3b01a26753d0e6c3c4b Author: Miklos Vajna Date: Wed May 14 11:36:35 2014 +0200 WIP: oox: trigger the TextBox property on XML_txbx Change-Id: Ia3e69e61073cc915c4462c9d3fcfe07b75ac3fb3 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - sw/qa writerfilter/source
sw/qa/extras/ooxmlexport/data/fdo78384.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport.cxx |7 +++ writerfilter/source/dmapper/DomainMapper.cxx | 11 ++- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +++ writerfilter/source/dmapper/DomainMapper_Impl.hxx |4 5 files changed, 32 insertions(+), 1 deletion(-) New commits: commit 0ae0cc447a71102bb8cea0ecc3ea5af486165cca Author: Miklos Vajna Date: Wed May 14 09:54:22 2014 +0200 writerfilter: DomainMapper_Impl::SetSymbolData() should take an int One wonders how did this work so far. Change-Id: I6aee6a2f7e15c1c4931ca5d65b6ad39d025ff9ed (cherry picked from commit 671eb12dee290607ed66f3b325f28e7bd4695cba) Signed-off-by: Andras Timar diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 92748f1..7f61328 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -325,7 +325,7 @@ void DomainMapper_Impl::RemoveLastParagraph( ) } } -void DomainMapper_Impl::SetSymbolData( bool nSymbolData ) +void DomainMapper_Impl::SetSymbolData( sal_Int32 nSymbolData ) { m_nSymboldata = nSymbolData; } diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index c8859a200..3c95a4c 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -461,7 +461,7 @@ public: void SetParaSectpr(bool bParaSectpr); bool GetParaSectpr(); -void SetSymbolData( bool nSymbolData ); +void SetSymbolData( sal_Int32 nSymbolData ); sal_Int32 GetSymbolData(); /// Setter method for m_bSdt. void SetSdt(bool bSdt); commit ba4b62e10924f43136c8ce048ce8504b44c5ec61 Author: Rohit Deshmukh Date: Thu May 8 16:33:44 2014 +0530 fdo#78384: Fix for corruption if file contains symbols. * In case of symbol, symbol character get imported first and then font of symbols. * So we are storing symbol character and when we parse symbol font then create UNO object for text. Reviewed-on: https://gerrit.libreoffice.org/9281 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna (cherry picked from commit f51640c5f40d5132b396a9fb6589420383df1610) Signed-off-by: Andras Timar Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx writerfilter/source/dmapper/DomainMapper_Impl.cxx Change-Id: If5b79521c6a59aec02b165e8120dafdd472cdaeb diff --git a/sw/qa/extras/ooxmlexport/data/fdo78384.docx b/sw/qa/extras/ooxmlexport/data/fdo78384.docx new file mode 100644 index 000..ee10264 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78384.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 7095ea2..ee5f974 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -2048,6 +2048,13 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx") // crashtest } +DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx") +{ +xmlDocPtr pXmlDoc = parseExport("word/document.xml"); +if (!pXmlDoc) +return; +assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings"); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index c7625e3..4a520c8 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -893,7 +893,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } else //it's a _real_ symbol { -utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 ); +m_pImpl->SetSymbolData(nIntValue); } break; case NS_rtf::LN_CHAR: //footnote symbol character @@ -911,7 +911,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } else //a real symbol if (m_pImpl->GetTopContext()) +{ m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( sStringValue )); +/* + * In case of symbol, symbol character get imported first and then font of symbols. + * So we are storing symbol character and when we parse symbol font then create UNO object for text. + */ +sal_Int32 symboldata = m_pImpl->GetSymbolData(); +utext( reinterpret_cast < const sal_uInt8 * >( &(symboldata) ), 1 ); +} + break; case NS_ooxml::LN_CT_Underline_val: handleUnderlineType(nIntValue, m_pImpl->
[Libreoffice-commits] core.git: writerfilter/source
writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit b28c0afdae884dff3a2f06adce80e3520f6ebf68 Author: Miklos Vajna Date: Wed May 14 14:52:19 2014 +0200 DomainMapper_Impl::AddDummyParaForTableInSection: shapes can't have sections Trying to add (and later remove) a dummy paragraph is just not needed at the moment, but it'll cause a real problem for textboxes. Change-Id: I9f90b515171ce4b498de49c2381b7324002e3c20 diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 9cda806..f3eb595 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -301,6 +301,9 @@ void DomainMapper_Impl::RemoveDummyParaForTableInSection() } void DomainMapper_Impl::AddDummyParaForTableInSection() { +// Shapes can't have sections. +if (IsInShape()) +return; if (!m_aTextAppendStack.empty()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] dev-tools.git: export-validation/README
export-validation/README |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 003d8b64e97abd433214adc1b21746b2e57a137b Author: Miklos Vajna Date: Wed May 14 15:15:42 2014 +0200 export-validation/README: add URL's Change-Id: I8b7d3e8d85178b5f2f72644061f88d3cfc8ea8b9 diff --git a/export-validation/README b/export-validation/README index d97aea1..2488e46 100644 --- a/export-validation/README +++ b/export-validation/README @@ -1,4 +1,7 @@ -We use ODF Validator for ODF export validation and officeotron for OOXML export validation. +We use ODF Validator [1] for ODF export validation and officeotron [2] for OOXML export validation. Both tools should be available through a wrapper script that is in the path and is called officeotron respectively odfvalidator and should have a form similar to the ones of the two scripts in this directory. + +[1] http://incubator.apache.org/odftoolkit/conformance/ODFValidator.html +[2] https://code.google.com/p/officeotron/ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/textbox' - 2 commits - sw/source writerfilter/source
sw/source/core/doc/textboxhelper.cxx |4 writerfilter/source/dmapper/DomainMapper_Impl.cxx |3 +++ 2 files changed, 7 insertions(+) New commits: commit 356c059eddab6ec72f259f4bbbc45adbf3329c4a Author: Miklos Vajna Date: Wed May 14 16:06:13 2014 +0200 SwTextBoxHelper::syncProperty(): avoid crash on not-yet-inserted shape Change-Id: Ic5d6a62ec3ba2e096e9257ab7d30004cf3213069 diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index ec27548..9937778 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -105,6 +105,10 @@ uno::Any SwTextBoxHelper::getXTextAppend(SwFrmFmt* pShape, const uno::Type& rTyp void SwTextBoxHelper::syncProperty(SwFrmFmt* pShape, sal_uInt16 nWID, sal_uInt8 nMemberId, const OUString& rPropertyName, const css::uno::Any& rValue) { +// No shape yet? Then nothing to do, initial properties are set by create(). +if (!pShape) +return; + uno::Any aValue(rValue); nMemberId &= ~CONVERT_TWIPS; commit df5d8624b7dfd68e206cd484d46723af4b91b441 Author: Miklos Vajna Date: Wed May 14 14:52:19 2014 +0200 DomainMapper_Impl::AddDummyParaForTableInSection: shapes can't have sections Change-Id: I9f90b515171ce4b498de49c2381b7324002e3c20 diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 410b064..248c436 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -300,6 +300,9 @@ void DomainMapper_Impl::RemoveDummyParaForTableInSection() } void DomainMapper_Impl::AddDummyParaForTableInSection() { +// Shapes can't have sections. +if (IsInShape()) +return; if (!m_aTextAppendStack.empty()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/textbox' - sw/inc sw/source
sw/inc/textboxhelper.hxx |2 ++ sw/source/core/doc/textboxhelper.cxx | 16 sw/source/core/unocore/unodraw.cxx |3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) New commits: commit f5731a1e78896bf32fe5e7fd36b38cc21553db5a Author: Miklos Vajna Date: Wed May 14 17:03:45 2014 +0200 SwXShape: allow setting TextBox property to false Change-Id: I3b501d6928cded0f4684817c24674423c1d6c2da diff --git a/sw/inc/textboxhelper.hxx b/sw/inc/textboxhelper.hxx index 93a459d..0c992dc 100644 --- a/sw/inc/textboxhelper.hxx +++ b/sw/inc/textboxhelper.hxx @@ -26,6 +26,8 @@ class SwTextBoxHelper public: /// Create a TextBox for a shape. static void create(SwFrmFmt* pShape); +/// Destroy a TextBox for a shape. +static void destroy(SwFrmFmt* pShape); /// Get XTextAppend of a shape's TextBox, if there is any. static css::uno::Any getXTextAppend(SwFrmFmt* pShape, const css::uno::Type& rType); /// Sync property of TextBox with the one of the shape. diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 9937778..faadb5f 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -65,6 +65,22 @@ void SwTextBoxHelper::create(SwFrmFmt* pShape) } } +void SwTextBoxHelper::destroy(SwFrmFmt* pShape) +{ +// If a TextBox was enabled previously +if (pShape->GetAttrSet().HasItem(RES_CNTNT)) +{ +SwFrmFmt* pFmt = findTextBox(pShape); + +// Unlink the TextBox's text range from the original shape. +pShape->ResetFmtAttr(RES_CNTNT); + +// Delete the associated TextFrame. +if (pFmt) +pShape->GetDoc()->DelLayoutFmt(pFmt); +} +} + SwFrmFmt* SwTextBoxHelper::findTextBox(SwFrmFmt* pShape) { SwFrmFmt* pRet = 0; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 5ece513..6a3261b 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1182,9 +1182,10 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a { bool bValue; aValue >>= bValue; -// If TextBox is to be enabled. if (bValue) SwTextBoxHelper::create(pFmt); +else +SwTextBoxHelper::destroy(pFmt); } // #i28749# ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - include/filter sw/source
include/filter/msfilter/sprmids.hxx | 315 --- sw/source/core/doc/docbm.cxx|3 sw/source/filter/ww8/sprmids.hxx| 316 sw/source/filter/ww8/wrtw8nds.cxx |2 sw/source/filter/ww8/wrtw8num.cxx |2 sw/source/filter/ww8/wrtw8sty.cxx |2 sw/source/filter/ww8/wrtww8.cxx |2 sw/source/filter/ww8/wrtww8gr.cxx |2 sw/source/filter/ww8/ww8atr.cxx |2 sw/source/filter/ww8/ww8par2.cxx|2 sw/source/filter/ww8/ww8par3.cxx|2 sw/source/filter/ww8/ww8par4.cxx|2 sw/source/filter/ww8/ww8par6.cxx|2 sw/source/filter/ww8/ww8scan.cxx|2 14 files changed, 329 insertions(+), 327 deletions(-) New commits: commit a14752a864b098976f684036cda1bd5d9c0dafc8 Author: Miklos Vajna Date: Wed May 14 22:24:55 2014 +0200 coverity#704863 Unchecked dynamic_cast Change-Id: I0c451cb576dc1818043816390b14c32607609748 diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 9e1d2e2..b28239f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -472,7 +472,8 @@ namespace sw { namespace mark sw::mark::IMark* pMark = makeMark( rPaM, rName, IDocumentMarkAccess::TEXT_FIELDMARK ); sw::mark::IFieldmark* pFieldMark = dynamic_cast( pMark ); -pFieldMark->SetFieldname( rType ); +if (pFieldMark) +pFieldMark->SetFieldname( rType ); return pFieldMark; } commit e8b74ad4135f9bddee4da2c85cdb3d5d0973d687 Author: Miklos Vajna Date: Wed May 14 22:20:28 2014 +0200 sw: fix indentation in sprmids Change-Id: Ifebb34942ab5d5e75d2ff9797c0450a825f955b8 diff --git a/sw/source/filter/ww8/sprmids.hxx b/sw/source/filter/ww8/sprmids.hxx index 656d624..a76a6de 100644 --- a/sw/source/filter/ww8/sprmids.hxx +++ b/sw/source/filter/ww8/sprmids.hxx @@ -21,293 +21,294 @@ #include -namespace NS_sprm { -const sal_uInt16 LN_PContextualSpacing = 0x246d; -const sal_uInt16 LN_PIstdPermute = 0xc601; -const sal_uInt16 LN_PTabProps = 0x646b; -const sal_uInt16 LN_TFCantSplit90 = 0x3466; -const sal_uInt16 LN_TCantSplit = 0x3644; -const sal_uInt16 LN_PIncLvl = 0x2602; -const sal_uInt16 LN_PJcExtra = 0x2461; -const sal_uInt16 LN_PJc = 0x2403; -const sal_uInt16 LN_PFSideBySide = 0x2404; -const sal_uInt16 LN_PFKeep = 0x2405; -const sal_uInt16 LN_PFKeepFollow = 0x2406; -const sal_uInt16 LN_PFPageBreakBefore = 0x2407; -const sal_uInt16 LN_PBrcl = 0x2408; -const sal_uInt16 LN_PBrcp = 0x2409; -const sal_uInt16 LN_PIlvl = 0x260a; -const sal_uInt16 LN_PIlfo = 0x460b; -const sal_uInt16 LN_PFNoLineNumb = 0x240c; -const sal_uInt16 LN_PChgTabsPapx = 0xc60d; -const sal_uInt16 LN_PDxaRight = 0x840e; -const sal_uInt16 LN_PDxaLeft = 0x840f; -const sal_uInt16 LN_PNest = 0x4610; -const sal_uInt16 LN_PDxaLeft180 = 0x8411; -const sal_uInt16 LN_PDyaLine = 0x6412; -const sal_uInt16 LN_PDyaBefore = 0xa413; -const sal_uInt16 LN_PDyaAfter = 0xa414; -const sal_uInt16 LN_PChgTabs = 0xc615; -const sal_uInt16 LN_PFInTable = 0x2416; -const sal_uInt16 LN_PCell = 0x244b; -const sal_uInt16 LN_PRow = 0x244c; -const sal_uInt16 LN_PFTtp = 0x2417; -const sal_uInt16 LN_PDxaAbs = 0x8418; -const sal_uInt16 LN_PDyaAbs = 0x8419; -const sal_uInt16 LN_PDxaWidth = 0x841a; -const sal_uInt16 LN_PPc = 0x261b; -const sal_uInt16 LN_PBrcTop10 = 0x461c; -const sal_uInt16 LN_PBrcLeft10 = 0x461d; -const sal_uInt16 LN_PBrcBottom10 = 0x461e; -const sal_uInt16 LN_PBrcRight10 = 0x461f; -const sal_uInt16 LN_PBrcBetween10 = 0x4620; -const sal_uInt16 LN_PBrcBar10 = 0x4621; -const sal_uInt16 LN_PDxaFromText10 = 0x4622; -const sal_uInt16 LN_PWr = 0x2423; -const sal_uInt16 LN_PBrcBar = 0x6629; -const sal_uInt16 LN_PFNoAutoHyph = 0x242a; -const sal_uInt16 LN_PWHeightAbs = 0x442b; -const sal_uInt16 LN_PDcs = 0x442c; -const sal_uInt16 LN_PShd = 0x442d; -const sal_uInt16 LN_PDyaFromText = 0x842e; -const sal_uInt16 LN_PDxaFromText = 0x842f; -const sal_uInt16 LN_PFLocked = 0x2430; -const sal_uInt16 LN_PFWidowControl = 0x2431; -const sal_uInt16 LN_PRuler = 0xc632; -const sal_uInt16 LN_PFKinsoku = 0x2433; -const sal_uInt16 LN_PFWordWrap = 0x2434; -const sal_uInt16 LN_PFOverflowPunct = 0x2435; -const sal_uInt16 LN_PFTopLinePunct = 0x2436; -const sal_uInt16 LN_PFAutoSpaceDE = 0x2437; -const sal_uInt16 LN_PFAutoSpaceDN = 0x2438; -const sal_uInt16 LN_PWAlignFont = 0x4439; -const sal_uInt16 LN_PFrameTextFlow = 0x443a; -const sal_uInt16 LN_PISnapBaseLine = 0x243b; -const sal_uInt16 LN_PAnld = 0xc63e; -const sal_uInt16 LN_PPropRMark = 0xc63f; -const sal_uInt16 LN_POutLvl = 0x2640; -const sal_uInt16 LN_PFBiDi = 0x2441; -const sal_uInt16 LN_PFNumRMIns = 0x2443; -
[Libreoffice-commits] core.git: sc/qa
sc/qa/unit/ucalc_formula.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 282b0123a34b978ea221d88ac668ed0c4423f801 Author: Miklos Vajna Date: Thu May 15 07:29:07 2014 +0200 error: invalid conversion from 'int' to 'formula::StackVar' Change-Id: I77280f843ae3123a6e0459becb2ce0b5fd7b78cc diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 7720881..b1ef561 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -821,11 +821,11 @@ void Test::testFormulaCompilerJumpReordering() TokenCheck aCheckRPN[] = { { ocPush, svSingleRef }, -{ ocIf,0 }, +{ ocIf,static_cast(0) }, { ocPush, svDouble}, -{ ocSep, 0 }, +{ ocSep, static_cast(0) }, { ocPush, svString}, -{ ocClose, 0 }, +{ ocClose, static_cast(0) }, }; sal_uInt16 nLen = pCode->GetCodeLen(); @@ -852,7 +852,7 @@ void Test::testFormulaCompilerJumpReordering() { ocPush, svSingleRef }, { ocPush, svDouble}, { ocPush, svString}, -{ ocIf,0 }, +{ ocIf,static_cast(0) }, }; nLen = pCode->GetCodeLen(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: chart2/source
chart2/source/view/charttypes/GL3DBarChart.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2cd7cbd9e36683d7429489dc0e4fea626a4cdb47 Author: Miklos Vajna Date: Thu May 15 08:06:00 2014 +0200 no matching function for call to 'scale(const float&, const float&, int)' Change-Id: Ia748133cb3bda9d81db8850b7c76ad1a43a5c42e diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index 8ceb3d9..d570c72 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -100,7 +100,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector& rDataSer float nXPos = nIndex * (nBarSizeX + nBarDistanceX); -glm::mat4 aScaleMatrix = glm::scale(nBarSizeX, nBarSizeY, 0); +glm::mat4 aScaleMatrix = glm::scale(nBarSizeX, nBarSizeY, static_cast(0)); glm::mat4 aTranslationMatrix = glm::translate(nXPos, nYPos, nVal); glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
sw/qa/extras/rtfimport/data/font-override.rtf | 28 ++ sw/qa/extras/rtfimport/rtfimport.cxx |6 + writerfilter/source/rtftok/rtfsprm.cxx|9 writerfilter/source/rtftok/rtfsprm.hxx|1 writerfilter/source/rtftok/rtfvalue.cxx | 12 ++- 5 files changed, 55 insertions(+), 1 deletion(-) New commits: commit c0fee7f70f4c7d97cd911c987d0b6dd57c6795e5 Author: Miklos Vajna Date: Mon Mar 3 18:54:01 2014 +0100 fdo#78313 RTF import: retain font colors This is a cherry-pick of two master commits: RTFValue::equals: consider the number of attributes/sprms as well (cherry picked from commit 4452fa9a2e741834a19c9b322fc8d9c8b06450de) Related: fdo#77600 RTF import: RTFValue::equals: compare attribute content Previously only the number of nested sprms / attributes was compared. With this, the font of the bugdoc is correctly Arial, not Times. (cherry picked from commit 8e8f9388c323ad3c32cef3f91609ad19386b7d56) Conflicts: writerfilter/source/rtftok/rtfsprm.hxx Change-Id: I351de414b6734336b31c1334dbd2349072f16002 Reviewed-on: https://gerrit.libreoffice.org/9316 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sw/qa/extras/rtfimport/data/font-override.rtf b/sw/qa/extras/rtfimport/data/font-override.rtf new file mode 100644 index 000..a41d2ab --- /dev/null +++ b/sw/qa/extras/rtfimport/data/font-override.rtf @@ -0,0 +1,28 @@ +{\rtf1\ansi\deff4\adeflang1025 +{\fonttbl +{\f0\froman\fprq2\fcharset0 Times New Roman;} +{\f1\froman\fprq2\fcharset2 Symbol;} +{\f2\fswiss\fprq2\fcharset0 Arial;} +{\f3\froman\fprq2\fcharset0 Liberation Serif +{\*\falt Times New Roman} +;} +{\f4\froman\fprq2\fcharset0 Times New Roman;} +{\f5\fswiss\fprq2\fcharset0 Liberation Sans +{\*\falt Arial} +;} +{\f6\froman\fprq2\fcharset0 Tahoma;} +{\f7\froman\fprq2\fcharset0 Arial;} +{\f8\fnil\fprq2\fcharset0 Droid Sans Fallback;} +{\f9\fnil\fprq2\fcharset0 Lucida Sans;} +{\f10\fswiss\fprq0\fcharset1 Lucida Sans;} +{\f11\fnil\fprq2\fcharset0 Arial;} +} +{\colortbl;\red0\green0\blue0;\red5\green99\blue193;\red128\green128\blue128;\red0\green0\blue10;} +{\stylesheet +{\s0\snext0\ql\widctlpar\ltrpar +\cf0\kerning1\dbch\af12\langfe1033\dbch\af12\afs20\alang1025\fs24\loch\f4\lang1033 Normal;} +} +\pard\plain\s0 +{\af11\f7 +This should be Arial.} +\par } diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 908178f..562b9df 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1635,6 +1635,12 @@ DECLARE_RTFIMPORT_TEST(testFdo75735, "fdo75735.rtf") CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence >(getParagraph(2), "ParaTabStops").getLength()); } +DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf") +{ +// This was "Times New Roman". +CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty(getRun(getParagraph(1), 1), "CharFontName")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index c6d9172..c79c6e2 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -143,6 +143,15 @@ void RTFSprms::deduplicate(RTFSprms& rReference) } } +bool RTFSprms::equals(RTFValue& rOther) +{ +RTFSprms::Iterator_t i = m_pSprms->begin(); +while (i != m_pSprms->end()) +if (!i->second->equals(rOther)) +return false; +return true; +} + void RTFSprms::ensureCopyBeforeWrite() { if (m_pSprms->m_nRefCount > 1) { diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx index 19f0514..a889207 100644 --- a/writerfilter/source/rtftok/rtfsprm.hxx +++ b/writerfilter/source/rtftok/rtfsprm.hxx @@ -60,6 +60,7 @@ namespace writerfilter { Iterator_t begin() { return m_pSprms->begin(); } Iterator_t end() { return m_pSprms->end(); } void clear(); +bool equals(RTFValue& rOther); private: void ensureCopyBeforeWrite(); boost::intrusive_ptr m_pSprms; diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx index 7af638f..132233c 100644 --- a/writerfilter/source/rtftok/rtfvalue.cxx +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -210,7 +210,17 @@ RTFValue* RTFValue::Clone() bool RTFValue::equals(RTFValue& rOther) { -return m_nValue == rOther.m_nValue; +if (m_nValue != rOther.m_nValue) +return false; +if (m_pAttributes->size() != rOther.m_pAttributes->size()) +return false; +else if (!m_pAttributes->equals(rOther)) +return false;
[Libreoffice-commits] core.git: sw/qa writerfilter/source
sw/qa/extras/ooxmlimport/data/chart-size.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 ++ writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 3 files changed, 14 insertions(+) New commits: commit 8bfbfc06fefb418269734cfb17c70a5ae5a42d2a Author: Miklos Vajna Date: Thu May 15 18:34:35 2014 +0200 DOCX import: fix chart size when it's inside a TextFrame Change-Id: I3edb253238db182054b7688061916a2432b687b5 diff --git a/sw/qa/extras/ooxmlimport/data/chart-size.docx b/sw/qa/extras/ooxmlimport/data/chart-size.docx new file mode 100644 index 000..da5d144 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/chart-size.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7c4e14b..3ffe132 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -2108,6 +2109,15 @@ DECLARE_OOXMLIMPORT_TEST(testMsoBrightnessContrast, "msobrightnesscontrast.docx" CPPUNIT_ASSERT_EQUAL( -50, int(data[0x6e4])); } +DECLARE_OOXMLIMPORT_TEST(testChartSize, "chart-size.docx") +{ +// When chart was in a TextFrame, its size was too large. +uno::Reference xTextEmbeddedObjectsSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xEmbeddedObjects(xTextEmbeddedObjectsSupplier->getEmbeddedObjects(), uno::UNO_QUERY); +// This was 10954. +CPPUNIT_ASSERT_EQUAL(sal_Int32(6008), getProperty(xEmbeddedObjects->getByIndex(0), "Width")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index f3eb595..4a5b8a4 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -4341,6 +4341,10 @@ void DomainMapper_Impl::ImportGraphic(writerfilter::Reference< Properties >::Po if( xTextContent.is()) appendTextContent( xTextContent, uno::Sequence< beans::PropertyValue >() ); +// Clear the reference, so in case the embedded object is inside a +// TextFrame, we won't try to resize it (to match the size of the +// TextFrame) here. +m_xEmbedded.clear(); m_pGraphicImport.reset(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: patchview in gerrit - everyone happy or needs some bigger revamp?
On Thu, May 15, 2014 at 03:12:21PM +0200, Christian Lohmaier wrote: > Any burning topics that you hate about gerrit's interface? I guess the most burning issue right now is that sometimes the submission gets stuck and you need to manually push the change + mark the review as abandoned, which is ugly -- and IIRC this was fine in the past, it came in after some upgrade. I think Norbert has the exact details, sounds like an upstream bug. UI annoyance is much less problematic, at least for me. signature.asc Description: Digital signature ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] core.git: sw/source
sw/source/core/docnode/nodedump.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 942156b1ed7d0cd27c18960bf4cf874689e9aa0a Author: Miklos Vajna Date: Fri May 16 13:45:56 2014 +0200 sw doc model dump: show SdrObject::nOrdNum Change-Id: I4ac2c3d883dd9bb111a2d600f5a17ea96a1e219e diff --git a/sw/source/core/docnode/nodedump.cxx b/sw/source/core/docnode/nodedump.cxx index 31d9821..ab888ad 100644 --- a/sw/source/core/docnode/nodedump.cxx +++ b/sw/source/core/docnode/nodedump.cxx @@ -146,6 +146,7 @@ void lcl_dumpSdrModel(WriterHelper& writer, const SdrModel* pModel) writer.writeFormatAttribute("name", "%s", BAD_CAST(OUStringToOString(pObject->GetName(), RTL_TEXTENCODING_UTF8).getStr())); writer.writeFormatAttribute("title", "%s", BAD_CAST(OUStringToOString(pObject->GetTitle(), RTL_TEXTENCODING_UTF8).getStr())); writer.writeFormatAttribute("description", "%s", BAD_CAST(OUStringToOString(pObject->GetDescription(), RTL_TEXTENCODING_UTF8).getStr())); +writer.writeFormatAttribute("nOrdNum", TMP_FORMAT, pObject->GetOrdNumDirect()); const OutlinerParaObject* pOutliner = pObject->GetOutlinerParaObject(); writer.startElement("outliner"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits