sw/inc/unocoll.hxx | 3 ++- sw/source/core/inc/frame.hxx | 3 ++- sw/source/core/layout/wsfrm.cxx | 6 +++--- sw/source/core/unocore/unocoll.cxx | 2 +- sw/source/core/unocore/unoredline.cxx | 3 ++- sw/source/core/unocore/unotext.cxx | 11 ++++------- sw/source/filter/ww8/docxtableexport.cxx | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-)
New commits: commit 41c04ceb3b1b14c3c99ede86524df8f3de4f5daa Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 20 12:55:15 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon May 20 19:14:14 2024 +0200 use more concrete UNO types in sw Change-Id: I3cf017e74e7cc9902486d6dba1d89f70c47c978a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167864 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index 6254801bf8a7..0ecca6fb45c2 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -40,6 +40,7 @@ class SwSectionFormat; struct SvEventDescription; class SwXFootnote; class SwXTextSection; +class SwXTextTable; const SvEventDescription* sw_GetSupportedMacroItems(); @@ -287,7 +288,7 @@ public: virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - SW_DLLPUBLIC static css::uno::Reference<css::text::XTextTable> GetObject(SwFrameFormat& rFormat); + SW_DLLPUBLIC static rtl::Reference<SwXTextTable> GetObject(SwFrameFormat& rFormat); }; typedef diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 24016c53350f..e00fa835f16a 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -973,7 +973,7 @@ uno::Sequence< OUString > SwXTextTables::getSupportedServiceNames() return { u"com.sun.star.text.TextTables"_ustr }; } -uno::Reference<text::XTextTable> SwXTextTables::GetObject(SwFrameFormat& rFormat) +rtl::Reference<SwXTextTable> SwXTextTables::GetObject(SwFrameFormat& rFormat) { return SwXTextTable::CreateXTextTable(& rFormat); } diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 27fd9aa7f555..b97cc20028b2 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -42,6 +42,7 @@ #include <IDocumentRedlineAccess.hxx> #include <IDocumentStylePoolAccess.hxx> #include <docary.hxx> +#include <unotbl.hxx> using namespace ::com::sun::star; @@ -422,7 +423,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName ) OSL_ENSURE(pTableNode, "No table node!"); SwTable& rTable = pTableNode->GetTable(); SwFrameFormat* pTableFormat = rTable.GetFrameFormat(); - xRet = SwXTextTables::GetObject( *pTableFormat ); + xRet = cppu::getXWeak(SwXTextTables::GetObject( *pTableFormat ).get()); } break; case SwNodeType::Text : diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 730e24ca6718..50d9f75db63f 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2214,9 +2214,8 @@ SwXText::convertToTable( if (!pTable) return uno::Reference< text::XTextTable >(); - uno::Reference<text::XTextTable> const xRet = + rtl::Reference<SwXTextTable> const xRet = SwXTextTable::CreateXTextTable(pTable->GetFrameFormat()); - uno::Reference<beans::XPropertySet> const xPrSet(xRet, uno::UNO_QUERY); // set properties to the table // catch lang::WrappedTargetException and lang::IndexOutOfBoundsException try @@ -2254,7 +2253,7 @@ SwXText::convertToTable( }; if (std::find(vDenylist.begin(), vDenylist.end(), rTableProperty.Name) == vDenylist.end()) { - xPrSet->setPropertyValue(rTableProperty.Name, rTableProperty.Value); + xRet->setPropertyValue(rTableProperty.Name, rTableProperty.Value); } } catch (const uno::Exception&) @@ -2270,7 +2269,6 @@ SwXText::convertToTable( for(sal_Int32 nCnt = 0; nCnt < nLast; ++nCnt) lcl_ApplyRowProperties(rRowProperties[nCnt], xRows->getByIndex(nCnt), aRowSeparators[nCnt]); - uno::Reference<table::XCellRange> const xCR(xRet, uno::UNO_QUERY_THROW); //apply cell properties sal_Int32 nRow = 0; for(const auto& rCellPropertiesForRow : rCellProperties) @@ -2280,7 +2278,7 @@ SwXText::convertToTable( { lcl_ApplyCellProperties(lcl_GetLeftPos(nCell, aRowSeparators[nRow]), rCellProps, - xCR->getCellByPosition(nCell, nRow), + xRet->getCellByPosition(nCell, nRow), aMergedCells); ++nCell; } @@ -2299,8 +2297,7 @@ SwXText::convertToTable( } assert(SwTable::FindTable(pTable->GetFrameFormat()) == pTable); - assert(pTable->GetFrameFormat() == - dynamic_cast<SwXTextTable&>(*xRet).GetFrameFormat()); + assert(pTable->GetFrameFormat() == xRet->GetFrameFormat()); return xRet; } diff --git a/sw/source/filter/ww8/docxtableexport.cxx b/sw/source/filter/ww8/docxtableexport.cxx index f6bbef34dddc..ba89f5695d04 100644 --- a/sw/source/filter/ww8/docxtableexport.cxx +++ b/sw/source/filter/ww8/docxtableexport.cxx @@ -38,6 +38,7 @@ #include <swmodule.hxx> #include <fmtrowsplt.hxx> #include <fmtwrapinfluenceonobjpos.hxx> +#include <unotbl.hxx> #include "docxexportfilter.hxx" #include "docxhelper.hxx" @@ -218,8 +219,7 @@ void DocxAttributeOutput::TableDefinition( nWidthPercent = rFrameSize.GetWidthPercent(); } - uno::Reference<beans::XPropertySet> xPropertySet( - SwXTextTables::GetObject(*pTable->GetFrameFormat()), uno::UNO_QUERY); + rtl::Reference<SwXTextTable> xPropertySet = SwXTextTables::GetObject(*pTable->GetFrameFormat()); bool isWidthRelative = false; xPropertySet->getPropertyValue("IsWidthRelative") >>= isWidthRelative; if (!isWidthRelative && !nWidthPercent) commit 6b9ff63cf448da9b49ca9485b276c7ecc1023a23 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon May 20 10:09:07 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon May 20 19:14:06 2024 +0200 remove hole in SwFrameAreaDefinition struct since this is used in various performance sensitive places Change-Id: Ibdce6bd0de458a5a970654a88b984aff49210ef4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 399ab4d0b448..d878bebf8f11 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -143,6 +143,8 @@ private: // When identical to FrameArea, Pos() will be (0, 0) and Size identical. SwRect maFramePrintArea; + sal_uInt32 mnFrameId; + // bitfield bool mbFrameAreaPositionValid : 1; bool mbFrameAreaSizeValid : 1; @@ -151,7 +153,6 @@ private: // #i65250# // frame ID is now in general available - used for layout loop control static sal_uInt32 snLastFrameId; - const sal_uInt32 mnFrameId; protected: // write access to mb*Valid flags diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index e238893c3fe3..68035e025695 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -72,10 +72,10 @@ using namespace ::com::sun::star; SwFrameAreaDefinition::SwFrameAreaDefinition() -: mbFrameAreaPositionValid(false), +: mnFrameId(SwFrameAreaDefinition::snLastFrameId++), + mbFrameAreaPositionValid(false), mbFrameAreaSizeValid(false), - mbFramePrintAreaValid(false), - mnFrameId(SwFrameAreaDefinition::snLastFrameId++) + mbFramePrintAreaValid(false) { }