diff options
author | jan iversen <jani@documentfoundation.org> | 2015-12-25 12:53:34 +0000 |
---|---|---|
committer | jan iversen <jani@documentfoundation.org> | 2015-12-25 20:02:27 +0000 |
commit | da5d3f0fc8edc38f3830644aee0507c7675b37b3 (patch) | |
tree | 69134ba4a8e5c69eb55c316f42f02e20f4dc4513 /sw | |
parent | df862448b7400c0d7406afa0540c52c00632b62f (diff) |
Revert "tdf#96412 Fix export text table cell UserDefinedAttributes to xml."
This reverts commit d3e57ccf2e56a75bd4f004de53793f1742e34bc4.
There is a problem with the test case, that breaks 2 tinderboxes.
A simple test, detected more errors, open the document in LO 5.0.x and save it, then the test case has a problem on all platforms.
Change-Id: If4d6a62ed5e7882e6e61e7d31ca0a29094df103c
Reviewed-on: https://gerrit.libreoffice.org/20935
Reviewed-by: jan iversen <jani@documentfoundation.org>
Tested-by: jan iversen <jani@documentfoundation.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 14 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/data/userdefattr-tablecell.odt | bin | 9172 -> 0 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 11 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 26 |
4 files changed, 1 insertions, 50 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index dc977f165b3b..ce02b3e51cf3 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -11,7 +11,6 @@ #define INCLUDED_SW_QA_EXTRAS_INC_SWMODELTESTBASE_HXX #include <com/sun/star/container/XContentEnumerationAccess.hpp> -#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/packages/zip/ZipFileAccess.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> @@ -29,7 +28,6 @@ #include <com/sun/star/sdb/DatabaseContext.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdbc/XRowSet.hpp> -#include <com/sun/star/xml/AttributeData.hpp> #include <test/bootstrapfixture.hxx> #include <test/xmltesttools.hxx> @@ -435,18 +433,6 @@ protected: return properties->getPropertySetInfo()->hasPropertyByName(name); } - xml::AttributeData getUserDefineAttribute(const uno::Any& obj, const OUString& name, const OUString& rValue = OUString()) const - { - uno::Reference<container::XNameContainer> attrsCnt(getProperty<uno::Any>(obj, "UserDefinedAttributes"), uno::UNO_QUERY_THROW); - - xml::AttributeData aValue; - attrsCnt->getByName(name) >>= aValue; - if (!rValue.isEmpty()) - CPPUNIT_ASSERT_EQUAL_MESSAGE("attribtes of cell does not contain expected value", rValue, aValue.Value); - - return aValue; - } - /// Get number of paragraphs of the document. int getParagraphs() { diff --git a/sw/qa/extras/odfexport/data/userdefattr-tablecell.odt b/sw/qa/extras/odfexport/data/userdefattr-tablecell.odt Binary files differdeleted file mode 100644 index c8f6dcca5f93..000000000000 --- a/sw/qa/extras/odfexport/data/userdefattr-tablecell.odt +++ /dev/null diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 1226228e5224..addf9c5c0ba2 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -770,17 +770,6 @@ DECLARE_ODFEXPORT_TEST(testOdtBorderTypes, "border_types.odt") } while (xParaEnum->hasMoreElements()); } -DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt") -{ - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(0), uno::UNO_QUERY); - uno::Reference<table::XCell> const xCellA1(xTable->getCellByName("A1"), uno::UNO_SET_THROW); - uno::Reference<table::XCell> const xCellB1(xTable->getCellByName("B1"), uno::UNO_SET_THROW); - uno::Reference<table::XCell> const xCellC1(xTable->getCellByName("C1"), uno::UNO_SET_THROW); - getUserDefineAttribute(uno::makeAny(xCellA1), "proName", "v1"); - getUserDefineAttribute(uno::makeAny(xCellB1), "proName", "v2"); - getUserDefineAttribute(uno::makeAny(xCellC1), "proName", "v3"); -} - #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 6b891a3710a6..227ea830d9b2 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -29,7 +29,6 @@ #include <svl/zforlist.hxx> #include <editeng/brushitem.hxx> #include <editeng/boxitem.hxx> -#include <editeng/xmlcnitm.hxx> #include <fmtrowsplt.hxx> #include <editeng/frmdiritem.hxx> #include <list> @@ -313,7 +312,6 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const SvxBoxItem *pBox = nullptr; const SwTableBoxNumFormat *pNumFormat = nullptr; const SvxFrameDirectionItem *pFrameDir = nullptr; - const SvXMLAttrContainerItem *pAttCnt = nullptr; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; @@ -333,12 +331,9 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, if ( SfxItemState::SET == rItemSet.GetItemState( RES_FRAMEDIR, false, &pItem ) ) pFrameDir = static_cast<const SvxFrameDirectionItem *>(pItem); - if ( SfxItemState::SET == rItemSet.GetItemState( RES_UNKNOWNATR_CONTAINER, - false, &pItem ) ) - pAttCnt = static_cast<const SvXMLAttrContainerItem *>(pItem); // empty styles have not to be exported - if( !pVertOrient && !pBrush && !pBox && !pNumFormat && !pFrameDir && !pAttCnt ) + if( !pVertOrient && !pBrush && !pBox && !pNumFormat && !pFrameDir ) return false; // order is: -/-/-/num, @@ -356,7 +351,6 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const SvxBoxItem *pTestBox = nullptr; const SwTableBoxNumFormat *pTestNumFormat = nullptr; const SvxFrameDirectionItem *pTestFrameDir = nullptr; - const SvXMLAttrContainerItem *pTestAttCnt = nullptr; const SwFrameFormat* pTestFormat = *i; const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_VERT_ORIENT, false, @@ -430,21 +424,6 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, } - if ( SfxItemState::SET == rTestSet.GetItemState( RES_UNKNOWNATR_CONTAINER, - false, &pItem ) ) - { - if( !pAttCnt ) - break; - - pTestAttCnt = static_cast<const SvXMLAttrContainerItem *>(pItem); - } - else - { - if ( pAttCnt ) - continue; - - } - if( pVertOrient && pVertOrient->GetVertOrient() != pTestVertOrient->GetVertOrient() ) continue; @@ -461,9 +440,6 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, if( pFrameDir && pFrameDir->GetValue() != pTestFrameDir->GetValue() ) continue; - if( pAttCnt && ( *pAttCnt != *pTestAttCnt ) ) - continue; - // found! rFrameFormat.SetName( pTestFormat->GetName() ); bInsert = false; |