Rebased ref, commits from common ancestor:
commit 2bb41a38de5a291756494aa8ac85445793018357
Author: Tomaž Vajngerl <[email protected]>
AuthorDate: Tue Aug 24 11:02:40 2021 +0900
Commit: Tomaž Vajngerl <[email protected]>
CommitDate: Wed Feb 9 16:28:41 2022 +0900
SVG export for drawinglayer primitives
Change-Id: I34e17eeb9695c9a8b23178611c149f89a28a210c
diff --git a/drawinglayer/CppunitTest_drawinglayer_processors.mk
b/drawinglayer/CppunitTest_drawinglayer_processors.mk
index b17a5107dc2d..fd0eb0b365c1 100644
--- a/drawinglayer/CppunitTest_drawinglayer_processors.mk
+++ b/drawinglayer/CppunitTest_drawinglayer_processors.mk
@@ -38,6 +38,7 @@ $(eval $(call
gb_CppunitTest_use_externals,drawinglayer_processors,\
$(eval $(call gb_CppunitTest_add_exception_objects,drawinglayer_processors, \
drawinglayer/qa/unit/vclmetafileprocessor2d \
drawinglayer/qa/unit/vclpixelprocessor2d \
+ drawinglayer/qa/unit/SvgExportTest \
))
$(eval $(call gb_CppunitTest_use_ure,drawinglayer_processors))
diff --git a/drawinglayer/Library_drawinglayer.mk
b/drawinglayer/Library_drawinglayer.mk
index 2430852d33bd..a05937a1d7cc 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -194,6 +194,7 @@ $(eval $(call
gb_Library_add_exception_objects,drawinglayer,\
drawinglayer/source/texture/texture \
drawinglayer/source/dumper/XShapeDumper \
drawinglayer/source/dumper/EnhancedShapeDumper \
+ drawinglayer/source/tools/SvgWriter \
))
# vim: set noet sw=4 ts=4:
diff --git a/drawinglayer/qa/unit/SvgExportTest.cxx
b/drawinglayer/qa/unit/SvgExportTest.cxx
new file mode 100644
index 000000000000..98198c2306e9
--- /dev/null
+++ b/drawinglayer/qa/unit/SvgExportTest.cxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <test/bootstrapfixture.hxx>
+
+#include <drawinglayer/tools/SvgWriter.hxx>
+
+#include <basegfx/range/b2drectangle.hxx>
+#include <basegfx/polygon/b2dpolypolygon.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
+#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
+
+using namespace drawinglayer;
+
+class SvgExportTest : public test::BootstrapFixture
+{
+public:
+ SvgExportTest()
+ : BootstrapFixture(true, false)
+ {
+ }
+
+ CPPUNIT_TEST_SUITE(SvgExportTest);
+ CPPUNIT_TEST(test);
+ CPPUNIT_TEST_SUITE_END();
+
+ void test()
+ {
+ SvFileStream aStream("~/test.svg", StreamMode::WRITE |
StreamMode::TRUNC);
+
+ primitive2d::Primitive2DContainer aPrimitives;
+
+ basegfx::BColor aBColor(1.0, 0.0, 0.0);
+
+ auto aPolygon
+ =
basegfx::utils::createPolygonFromRect(basegfx::B2DRectangle(10.0, 10.0, 50.0,
60.0));
+ basegfx::B2DPolyPolygon aPolyPolygon(aPolygon);
+
+ auto pStrokePrimitive(
+ new
drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(aPolyPolygon, aBColor));
+
+
aPrimitives.push_back(drawinglayer::primitive2d::Primitive2DReference(pStrokePrimitive));
+
+ svg::SvgWriter aWriter(aStream, svg::SvgVersion::v1_1);
+ aWriter.write(aPrimitives);
+ }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION(SvgExportTest);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/tools/SvgWriter.cxx
b/drawinglayer/source/tools/SvgWriter.cxx
new file mode 100644
index 000000000000..c0435d19a001
--- /dev/null
+++ b/drawinglayer/source/tools/SvgWriter.cxx
@@ -0,0 +1,211 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <memory>
+#include <sal/log.hxx>
+
+#include <drawinglayer/tools/SvgWriter.hxx>
+
+#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
+#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
+#include <drawinglayer/primitive2d/Tools.hxx>
+#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
+#include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
+#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
+#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx>
+#include <drawinglayer/primitive2d/svggradientprimitive2d.hxx>
+#include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
+#include <drawinglayer/geometry/viewinformation2d.hxx>
+#include <drawinglayer/attribute/lineattribute.hxx>
+#include <drawinglayer/attribute/fontattribute.hxx>
+
+#include <primitive2d/textlineprimitive2d.hxx>
+
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
+namespace svg
+{
+SvgWriter::SvgWriter(SvStream& rStream, SvgVersion eSvgVersion)
+ : mrStream(rStream)
+ , maWriter(&mrStream)
+ , meSvgVersion(eSvgVersion)
+{
+}
+
+bool SvgWriter::write(const drawinglayer::primitive2d::Primitive2DContainer&
rPrimitive2DSequence)
+{
+ maWriter.startDocument();
+ maWriter.startElement("svg");
+ OString aVersion = meSvgVersion == SvgVersion::v1_1 ? "1.1" : "2";
+ maWriter.attribute("version", aVersion);
+ maWriter.attribute("xmlns", "http://www.w3.org/2000/svg");
+
+ drawinglayer::primitive2d::VisitorParameters aParameters; // default
+
+ auto aRange = rPrimitive2DSequence.getB2DRange(aParameters);
+
+ maWriter.attribute("width", aRange.getWidth());
+ maWriter.attribute("height", aRange.getHeight());
+
+ decomposeAndWrite(rPrimitive2DSequence);
+
+ maWriter.endElement();
+ maWriter.endDocument();
+
+ return true;
+}
+
+void SvgWriter::decomposeAndWrite(
+ const drawinglayer::primitive2d::Primitive2DContainer&
rPrimitive2DSequence)
+{
+ drawinglayer::primitive2d::VisitorParameters aVisitorParameters;
+
+ for (size_t i = 0; i < rPrimitive2DSequence.size(); i++)
+ {
+ auto xPrimitive2DReference = rPrimitive2DSequence[i];
+
+ const auto* pBasePrimitive
+ = dynamic_cast<const drawinglayer::primitive2d::BasePrimitive2D*>(
+ xPrimitive2DReference.get());
+
+ if (!pBasePrimitive)
+ continue;
+
+ sal_uInt32 nId = pBasePrimitive->getPrimitive2DID();
+
+ switch (nId)
+ {
+ case PRIMITIVE2D_ID_BITMAPPRIMITIVE2D:
+ {
+ }
+ break;
+ case PRIMITIVE2D_ID_HIDDENGEOMETRYPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TRANSFORMPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_POLYPOLYGONCOLORPRIMITIVE2D:
+ {
+ ;
+ }
+ break;
+ case PRIMITIVE2D_ID_POINTARRAYPRIMITIVE2D:
+ {
+ }
+ break;
+ case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D:
+ {
+ }
+ break;
+ case PRIMITIVE2D_ID_POLYPOLYGONSTROKEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_POLYGONHAIRLINEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTDECORATEDPORTIONPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTLINEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_GROUPPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_MASKPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_SVGRADIALGRADIENTPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_SVGLINEARGRADIENTPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYBLOCKPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYPARAGRAPHPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_TEXTHIERARCHYLINEPRIMITIVE2D:
+ {
+ }
+ break;
+
+ case PRIMITIVE2D_ID_SHADOWPRIMITIVE2D:
+ {
+ }
+ break;
+
+ default:
+ {
+ }
+ break;
+ }
+ }
+}
+
+} // end namespace drawinglayer
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/tools/SvgWriter.hxx
b/include/drawinglayer/tools/SvgWriter.hxx
new file mode 100644
index 000000000000..f4b23dde8e92
--- /dev/null
+++ b/include/drawinglayer/tools/SvgWriter.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+#include <sal/config.h>
+#include <tools/stream.hxx>
+#include <tools/XmlWriter.hxx>
+
+#include <drawinglayer/primitive2d/Primitive2DContainer.hxx>
+
+namespace svg
+{
+enum class SvgVersion
+{
+ v1_1,
+ v2
+};
+
+class DRAWINGLAYER_DLLPUBLIC SvgWriter
+{
+private:
+ SvStream& mrStream;
+ tools::XmlWriter maWriter;
+ SvgVersion meSvgVersion;
+
+ void
+ decomposeAndWrite(const drawinglayer::primitive2d::Primitive2DContainer&
rPrimitive2DSequence);
+
+public:
+ SvgWriter(SvStream& rStream, SvgVersion eSvgVersion = SvgVersion::v1_1);
+ bool write(const drawinglayer::primitive2d::Primitive2DContainer&
rPrimitive2DSequence);
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 932a5f0f0aea5d3904f084526cd59991c98365d9
Author: Tomaž Vajngerl <[email protected]>
AuthorDate: Tue Aug 24 10:59:19 2021 +0900
Commit: Tomaž Vajngerl <[email protected]>
CommitDate: Wed Feb 9 16:28:38 2022 +0900
Introduce BasicPrimitive2D interface
Change-Id: I75e125e717038f10210ece291c94f46ac7e0ce89
diff --git a/include/drawinginterface/BasicPrimitive2D.hxx
b/include/drawinginterface/BasicPrimitive2D.hxx
new file mode 100644
index 000000000000..b7ef8da101b8
--- /dev/null
+++ b/include/drawinginterface/BasicPrimitive2D.hxx
@@ -0,0 +1,26 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ *
+ */
+
+#pragma once
+
+namespace drawinginterface
+{
+class BasicPrimitive2D
+{
+public:
+};
+
+class PolyPolygonBasicPrimitive : public BasicPrimitive2D
+{
+public:
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
b/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
index 25b0aad475aa..560960001961 100644
--- a/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
+++ b/include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx
@@ -22,6 +22,7 @@
#include <drawinglayer/drawinglayerdllapi.h>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinginterface/BasicPrimitive2D.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/color/bcolor.hxx>
@@ -33,7 +34,9 @@ namespace drawinglayer::primitive2d
This is one of the non-decomposable primitives, so a renderer
should process it.
*/
-class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D final : public
BasePrimitive2D
+class DRAWINGLAYER_DLLPUBLIC PolyPolygonColorPrimitive2D final
+ : public BasePrimitive2D,
+ public drawinginterface::PolyPolygonBasicPrimitive
{
private:
/// the tools::PolyPolygon geometry
commit 19a5e50955ecc8da7ff5dbdfb9f47352d851ee1d
Author: Justin Luth <[email protected]>
AuthorDate: Tue Feb 8 08:06:52 2022 +0200
Commit: Justin Luth <[email protected]>
CommitDate: Wed Feb 9 08:19:24 2022 +0100
related tdf#79186 filter: value is more than just LayoutInCell
nGroupShapeBooleanProperties contains 16 shape properties
and 16 flags to indicate whether they are to be used or not.
Up till now, only fLayoutInCell has been used by LO,
but it handles far more than that, so lets change the code
(now that we have the documentation for it)
to make it clear that this could be useful for further
compatibility fixes.
There is no need to determine whether the setting
has been provided or not - since a zero default indicates
everything in this bit-set should be ignored.
The naming and the if clause in ww8graf.cxx suggests that
reverse engineering didn't really grasp how this worked,
so I took the liberty of removing all of that awkwardness,
and verified that at least several associated document
from the OOo Apache bugtracker still worked.
===============================================================
https://docs.microsoft.com/en-us/openspecs/office_file_formats
/ms-odraw/a0ae6aa5-16e4-4550-87a2-b8ca180c7fd7
fLayoutInCell (1 bit): A bit that specifies whether this shape
is displayed inside a table cell. If fUsefLayoutInCell equals 0x0,
this value MUST be ignored.
The default value for this property is 0x1.
Change-Id: I82f80123a7419a83737b796f253406576732b6c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129657
Tested-by: Jenkins
Reviewed-by: Justin Luth <[email protected]>
diff --git a/filter/source/msfilter/msdffimp.cxx
b/filter/source/msfilter/msdffimp.cxx
index 8832617a4e58..a0ecad074ac6 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -5158,7 +5158,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
case 0x0392:
pImpRec->nYRelTo = nUDData;
break;
- case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ case 0x03BF: pImpRec->nGroupShapeBooleanProperties =
nUDData; break;
case 0x0393:
// This seems to correspond to o:hrpct from .docx (even
including
// the difference that it's in 0.1% even though the .docx
spec
@@ -7413,7 +7413,7 @@ SvxMSDffImportRec::SvxMSDffImportRec()
nClientDataLen( 0 ),
nXAlign( 0 ), // position n cm from left
nYAlign( 0 ), // position n cm below
- nLayoutInTableCell( 0 ), // element is laid out in table cell
+ nGroupShapeBooleanProperties(0), // 16 settings:
LayoutInCell/AllowOverlap/BehindDocument...
nFlags( ShapeFlag::NONE ),
nDxTextLeft( 144 ),
nDyTextTop( 72 ),
@@ -7450,7 +7450,7 @@ SvxMSDffImportRec::SvxMSDffImportRec(const
SvxMSDffImportRec& rCopy)
nXRelTo( rCopy.nXRelTo ),
nYAlign( rCopy.nYAlign ),
nYRelTo( rCopy.nYRelTo ),
- nLayoutInTableCell( rCopy.nLayoutInTableCell ),
+ nGroupShapeBooleanProperties(rCopy.nGroupShapeBooleanProperties),
nFlags( rCopy.nFlags ),
nDxTextLeft( rCopy.nDxTextLeft ),
nDyTextTop( rCopy.nDyTextTop ),
diff --git a/include/filter/msfilter/msdffimp.hxx
b/include/filter/msfilter/msdffimp.hxx
index 581d5586a78b..f56738e0050a 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -228,7 +228,7 @@ struct MSFILTER_DLLPUBLIC SvxMSDffImportRec
std::optional<sal_uInt32> nXRelTo;
sal_uInt32 nYAlign;
std::optional<sal_uInt32> nYRelTo;
- sal_uInt32 nLayoutInTableCell;
+ sal_uInt32 nGroupShapeBooleanProperties;
ShapeFlag nFlags;
sal_Int32 nDxTextLeft; ///< distance of text box from surrounding
shape
sal_Int32 nDyTextTop;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 113016dc036b..3cb0aebf6bc8 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -2402,7 +2402,7 @@ RndStdIds
SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec& rRecord, WW8_FS
if (m_nInTable &&
(eHoriRel == text::RelOrientation::FRAME || eHoriRel ==
text::RelOrientation::CHAR) &&
rFSPA.nwr == 3 &&
- !IsObjectLayoutInTableCell(rRecord.nLayoutInTableCell))
+ !IsObjectLayoutInTableCell(rRecord.nGroupShapeBooleanProperties))
{
eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
}
@@ -2452,7 +2452,7 @@ RndStdIds
SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec& rRecord, WW8_FS
}
// #i84783#
-bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32
nLayoutInTableCell ) const
+bool SwWW8ImplReader::IsObjectLayoutInTableCell(const sal_uInt32
nGroupShapeBooleanProperties) const
{
bool bIsObjectLayoutInTableCell = false;
@@ -2474,7 +2474,7 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const
sal_uInt32 nLayoutInTable
case 0x0000: // version 8 aka Microsoft Word 97
{
bIsObjectLayoutInTableCell = false;
- OSL_ENSURE( nLayoutInTableCell == 0xFFFFFFFF,
+ OSL_ENSURE(nGroupShapeBooleanProperties == 0,
"no explicit object attribute layout in table cell
expected." );
}
break;
@@ -2485,23 +2485,11 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const
sal_uInt32 nLayoutInTable
case 0xC000: // version 14 aka Microsoft Word 2010
case 0xE000: // version 15 aka Microsoft Word 2013
{
- // #i98037#
- // adjustment of conditions needed after deeper analysis of
- // certain test cases.
- if ( nLayoutInTableCell == 0xFFFFFFFF || // no explicit
attribute value given
- nLayoutInTableCell == 0x80008000 ||
- ( nLayoutInTableCell & 0x02000000 &&
- !(nLayoutInTableCell & 0x80000000 ) ) )
- {
- bIsObjectLayoutInTableCell = true;
- }
- else
- {
- // Documented in [MS-ODRAW], 2.3.4.44 "Group Shape Boolean
Properties".
- bool fUsefLayoutInCell = (nLayoutInTableCell & 0x80000000)
>> 31;
- bool fLayoutInCell = (nLayoutInTableCell & 0x8000) >> 15;
- bIsObjectLayoutInTableCell = fUsefLayoutInCell &&
fLayoutInCell;
- }
+ // Documented in [MS-ODRAW], 2.3.4.44 "Group Shape Boolean
Properties".
+ bool fUsefLayoutInCell = (nGroupShapeBooleanProperties &
0x80000000) >> 31;
+ bool fLayoutInCell = (nGroupShapeBooleanProperties & 0x8000)
>> 15;
+ // If unspecified, defaults to true
+ bIsObjectLayoutInTableCell = !fUsefLayoutInCell ||
fLayoutInCell;
}
break;
default:
@@ -2696,7 +2684,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer(
tools::Long nGrafAnchorCp )
return nullptr;
}
const bool bLayoutInTableCell =
- m_nInTable && IsObjectLayoutInTableCell( pRecord->nLayoutInTableCell );
+ m_nInTable &&
IsObjectLayoutInTableCell(pRecord->nGroupShapeBooleanProperties);
// #i18732# - Switch on 'follow text flow', if object is laid out
// inside table cell
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 2e764b755ae6..5bcf33eba878 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -626,9 +626,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
maShapeRecords.Current()->nRecLen,
pImpRec->pClientDataBuffer, pImpRec->nClientDataLen );
- // process user (== Winword) defined parameters in 0xF122 record
- // #i84783# - set special value to determine, if property is provided
or not.
- pImpRec->nLayoutInTableCell = 0xFFFFFFFF;
+ pImpRec->nGroupShapeBooleanProperties = 0;
if( maShapeRecords.SeekToContent( rSt,
DFF_msofbtUDefProp,
@@ -660,7 +658,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
case 0x0392:
pImpRec->nYRelTo = nUDData;
break;
- case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ case 0x03BF: pImpRec->nGroupShapeBooleanProperties =
nUDData; break;
case 0x0393:
// This seems to correspond to o:hrpct from .docx (even
including
// the difference that it's in 0.1% even though the .docx
spec
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 4315dbc15716..8d05ea2f3260 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -1718,7 +1718,7 @@ private:
// #i84783#
// determine object attribute "Layout in Table Cell"
- bool IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTableCell )
const;
+ bool IsObjectLayoutInTableCell(const sal_uInt32
nGroupShapeBooleanProperties) const;
void ReadGlobalTemplateSettings( std::u16string_view sCreatedFrom, const
css::uno::Reference< css::container::XNameContainer >& xPrjNameMap );
SwWW8ImplReader(const SwWW8ImplReader &) = delete;
SwWW8ImplReader& operator=(const SwWW8ImplReader&) = delete;
commit 69f62aea8bfaa6d80cf9f54bd01e9af6fca0f9bb
Author: Miklos Vajna <[email protected]>
AuthorDate: Tue Feb 8 20:20:34 2022 +0100
Commit: Miklos Vajna <[email protected]>
CommitDate: Wed Feb 9 08:17:28 2022 +0100
CppunitTest_sw_ooxmlexport: avoid mustTestImportOf()
Can use CPPUNIT_TEST_FIXTURE() instead.
See commit a226cec52e536c46e03f57a5f1f7931abbeb0cdd
(CppunitTest_sw_rtfimport: convert one testcase to use
CPPUNIT_TEST_FIXTURE(), 2019-11-05) for motivation.
Change-Id: Id86c3c7129fe3f61351325eda8a6f0b44efd2151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129691
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <[email protected]>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d11dc3f7f2e1..d1a348612779 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -38,14 +38,6 @@ public:
Test() : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open
XML Text") {}
protected:
- /**
- * Denylist handling
- */
- bool mustTestImportOf(const char* filename) const override {
- // If the testcase is stored in some other format, it's pointless to
test.
- return OString(filename).endsWith(".docx");
- }
-
/**
* Validation handling
*/
@@ -87,8 +79,9 @@ CPPUNIT_TEST_FIXTURE(Test, testFooterBodyDistance)
// Check for correct header/footer with special first page with TOC inside:
// - DECLARE_ODFEXPORT_TEST(testTdf118393, "tdf118393.odt")
// - DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt")
-DECLARE_OOXMLEXPORT_TEST(testTdf118393, "tdf118393.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf118393)
{
+ loadAndReload("tdf118393.odt");
CPPUNIT_ASSERT_EQUAL( 7, getPages() );
// First page has no header/footer
@@ -219,8 +212,9 @@ DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooter,
"first-header-footer.docx")
CPPUNIT_ASSERT_EQUAL(OUString("Even page footer 2"),
parseDump("/root/page[6]/footer/txt/text()"));
}
-DECLARE_OOXMLEXPORT_TEST(testFirstHeaderFooterB, "first-header-footerB.odt")
+CPPUNIT_TEST_FIXTURE(Test, testFirstHeaderFooterB)
{
+ loadAndReload("first-header-footerB.odt");
CPPUNIT_ASSERT_EQUAL( 6, getPages() );
CPPUNIT_ASSERT_EQUAL(OUString("First page header"),
parseDump("/root/page[1]/header/txt/text()"));
@@ -407,8 +401,9 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont,
"numbering-font.docx")
CPPUNIT_ASSERT_EQUAL(OUString("Verdana"), sOverrideFontName);
}
-DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering,
"tdf106541_noinheritChapterNumbering.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf106541_noinheritChapterNumbering)
{
+ loadAndReload("tdf106541_noinheritChapterNumbering.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
// in LO, it appears that styles based on the Chapter Numbering style
explicitly set the
// numbering style/outline level to 0 by default, and that LO prevents
inheriting directly from "Outline" style.
@@ -872,8 +867,9 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtentMargin,
"effectextent-margin.docx")
CPPUNIT_ASSERT_EQUAL(oox::drawingml::convertEmuToHmm(114300+95250),
getProperty<sal_Int32>(getShape(1), "LeftMargin"));
}
-DECLARE_OOXMLEXPORT_TEST(testTdf88583, "tdf88583.odt")
+CPPUNIT_TEST_FIXTURE(Test, testTdf88583)
{
+ loadAndReload("tdf88583.odt");
CPPUNIT_ASSERT_EQUAL(1, getPages());
CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID,
getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle"));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0x00cc00),
getProperty<sal_Int32>(getParagraph(1), "FillColor"));
commit 7c62e59587949344160dd346f7e060577fbc3490
Author: Noel Grandin <[email protected]>
AuthorDate: Tue Feb 8 20:41:22 2022 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Wed Feb 9 07:34:22 2022 +0100
use more concrete types in chart2, Axis
Change-Id: Ia47fd6deedd0a1cf6bedc882cb9817206dfa88b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129690
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git
a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index aff808e82a15..2af84b9142df 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -291,7 +291,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem(
sal_uInt16 nWhichId, const Sf
rItemSet.Get( nWhichId )).GetValue();
if( m_xCooSys.is() )
{
- uno::Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 1,
0, m_xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 1, 0,
m_xCooSys );
if( xAxis.is() )
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx
b/chart2/source/controller/main/ChartController_Insert.cxx
index 44195bb102a7..d184850b0dc6 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -742,7 +742,7 @@ void ChartController::executeDispatch_InsertAxis()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeAxisVisible( xAxis );
@@ -764,7 +764,7 @@ void ChartController::executeDispatch_DeleteAxis()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeAxisInvisible( xAxis );
@@ -786,7 +786,7 @@ void ChartController::executeDispatch_InsertMajorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeGridVisible( xAxis->getGridProperties() );
@@ -808,7 +808,7 @@ void ChartController::executeDispatch_DeleteMajorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
AxisHelper::makeGridInvisible( xAxis->getGridProperties() );
@@ -830,7 +830,7 @@ void ChartController::executeDispatch_InsertMinorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
const Sequence< Reference< beans::XPropertySet > > aSubGrids(
xAxis->getSubGridProperties() );
@@ -854,7 +854,7 @@ void ChartController::executeDispatch_DeleteMinorGrid()
try
{
- Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
+ rtl::Reference< Axis > xAxis = ObjectIdentifier::getAxisForCID(
m_aSelection.getSelectedCID(), getChartModel() );
if( xAxis.is() )
{
const Sequence< Reference< beans::XPropertySet > > aSubGrids(
xAxis->getSubGridProperties() );
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index b222691b74cf..c5e15205b325 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -123,7 +123,7 @@ void setLabelPosition(const
rtl::Reference<::chart::ChartModel>& xModel,
bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel,
const OUString& rCID)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
@@ -137,7 +137,7 @@ bool isReverse(const rtl::Reference<::chart::ChartModel>&
xModel,
void setReverse(const rtl::Reference<::chart::ChartModel>& xModel,
const OUString& rCID, bool bReverse)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx
b/chart2/source/model/template/ChartTypeTemplate.cxx
index 362706a68a66..1398785066fe 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -496,7 +496,7 @@ void ChartTypeTemplate::createCoordinateSystems(
// #i69680# make grid of first y-axis visible (was in the CooSys CTOR
before)
if( xCooSys->getDimension() >= 2 )
{
- Reference< chart2::XAxis > xAxis( xCooSys->getAxisByDimension( 1, 0 ));
+ rtl::Reference< Axis > xAxis = xCooSys->getAxisByDimension2( 1, 0 );
if( xAxis.is())
AxisHelper::makeGridVisible( xAxis->getGridProperties() );
}
@@ -673,7 +673,7 @@ void ChartTypeTemplate::adaptAxes(
sal_Int32 nMaxAxisIndex = xCooSys->getMaximumAxisIndexByDimension(
nDim );
for( sal_Int32 nAxisIndex=0; nAxisIndex<=nMaxAxisIndex;
nAxisIndex++ )
{
- Reference< XAxis > xAxis( AxisHelper::getAxis( nDim,
nAxisIndex, xCooSys ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( nDim,
nAxisIndex, xCooSys );
if( !xAxis.is() )
continue;
@@ -683,13 +683,9 @@ void ChartTypeTemplate::adaptAxes(
bool bPercent = (getStackMode(0) ==
StackMode::YStackedPercent);
if( bPercent && nDim == 1 )
{
- Reference< beans::XPropertySet > xAxisProp( xAxis,
uno::UNO_QUERY );
- if( xAxisProp.is())
- {
- // set number format to source format
-
xAxisProp->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
- xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT,
uno::Any());
- }
+ // set number format to source format
+
xAxis->setPropertyValue(CHART_UNONAME_LINK_TO_SRC_NUMFMT, uno::Any(true));
+ xAxis->setPropertyValue(CHART_UNONAME_NUMFMT,
uno::Any());
}
}
}
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx
b/chart2/source/model/template/PieChartTypeTemplate.cxx
index 9369104f5b52..da7ec3bef878 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -542,8 +542,8 @@ void PieChartTypeTemplate::resetStyles( const
rtl::Reference< ::chart::Diagram >
{
try
{
- Reference< chart2::XAxis > xAxis( AxisHelper::getAxis( 0
/*nDimensionIndex*/,0 /*nAxisIndex*/
- , coords ) );
+ rtl::Reference< Axis > xAxis = AxisHelper::getAxis( 0
/*nDimensionIndex*/,0 /*nAxisIndex*/
+ , coords );
if( xAxis.is() )
{
chart2::ScaleData aScaleData( xAxis->getScaleData() );
diff --git a/chart2/source/tools/AxisHelper.cxx
b/chart2/source/tools/AxisHelper.cxx
index 2418ca2097b0..046822980bc0 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -1148,7 +1148,7 @@ void AxisHelper::setRTLAxisLayout( const rtl::Reference<
BaseCoordinateSystem >&
try
{
//reverse direction for horizontal main axis
- Reference< chart2::XAxis > xHorizontalMainAxis( AxisHelper::getAxis(
nHorizontalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xHorizontalMainAxis = AxisHelper::getAxis(
nHorizontalAxisDimension, MAIN_AXIS_INDEX, xCooSys );
if( xHorizontalMainAxis.is() )
{
chart2::ScaleData aScale = xHorizontalMainAxis->getScaleData();
@@ -1157,7 +1157,7 @@ void AxisHelper::setRTLAxisLayout( const rtl::Reference<
BaseCoordinateSystem >&
}
//mathematical direction for vertical main axis
- Reference< chart2::XAxis > xVerticalMainAxis( AxisHelper::getAxis(
nVerticalAxisDimension, MAIN_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xVerticalMainAxis = AxisHelper::getAxis(
nVerticalAxisDimension, MAIN_AXIS_INDEX, xCooSys );
if( xVerticalMainAxis.is() )
{
chart2::ScaleData aScale = xVerticalMainAxis->getScaleData();
@@ -1173,7 +1173,7 @@ void AxisHelper::setRTLAxisLayout( const rtl::Reference<
BaseCoordinateSystem >&
try
{
//reverse direction for horizontal secondary axis
- Reference< chart2::XAxis > xHorizontalSecondaryAxis(
AxisHelper::getAxis( nHorizontalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys )
);
+ rtl::Reference< Axis > xHorizontalSecondaryAxis = AxisHelper::getAxis(
nHorizontalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys );
if( xHorizontalSecondaryAxis.is() )
{
chart2::ScaleData aScale =
xHorizontalSecondaryAxis->getScaleData();
@@ -1182,7 +1182,7 @@ void AxisHelper::setRTLAxisLayout( const rtl::Reference<
BaseCoordinateSystem >&
}
//mathematical direction for vertical secondary axis
- Reference< chart2::XAxis > xVerticalSecondaryAxis(
AxisHelper::getAxis( nVerticalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys ) );
+ rtl::Reference< Axis > xVerticalSecondaryAxis = AxisHelper::getAxis(
nVerticalAxisDimension, SECONDARY_AXIS_INDEX, xCooSys );
if( xVerticalSecondaryAxis.is() )
{
chart2::ScaleData aScale = xVerticalSecondaryAxis->getScaleData();
diff --git a/chart2/source/tools/DiagramHelper.cxx
b/chart2/source/tools/DiagramHelper.cxx
index 867e047ca1dd..f1021442f617 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -523,7 +523,7 @@ bool DiagramHelper::attachSeriesToAxis( bool
bAttachToMainAxis
sal_Int32 nNewAxisIndex = bAttachToMainAxis ? 0 : 1;
sal_Int32 nOldAxisIndex =
DataSeriesHelper::getAttachedAxisIndex(xDataSeries);
- uno::Reference< chart2::XAxis > xOldAxis( DiagramHelper::getAttachedAxis(
xDataSeries, xDiagram ) );
+ rtl::Reference< Axis > xOldAxis = DiagramHelper::getAttachedAxis(
xDataSeries, xDiagram );
if( nOldAxisIndex != nNewAxisIndex )
{
@@ -674,13 +674,13 @@ rtl::Reference< ChartType >
namespace
{
-std::vector< Reference< XAxis > > lcl_getAxisHoldingCategoriesFromDiagram(
+std::vector< rtl::Reference< Axis > > lcl_getAxisHoldingCategoriesFromDiagram(
const rtl::Reference< Diagram > & xDiagram )
{
- std::vector< Reference< XAxis > > aRet;
+ std::vector< rtl::Reference< Axis > > aRet;
// return first x-axis as fall-back
- Reference< XAxis > xFallBack;
+ rtl::Reference< Axis > xFallBack;
if (xDiagram.is()) try
{
for( rtl::Reference< BaseCoordinateSystem > const & xCooSys :
xDiagram->getBaseCoordinateSystems() )
@@ -701,7 +701,7 @@ std::vector< Reference< XAxis > >
lcl_getAxisHoldingCategoriesFromDiagram(
aRet.push_back(xAxis);
}
if( (nN == 0) && !xFallBack.is())
- xFallBack.set( xAxis );
+ xFallBack = xAxis;
}
}
}
@@ -758,10 +758,10 @@ void DiagramHelper::setCategoriesToDiagram(
bool bSetAxisType /* = false */,
bool bCategoryAxis /* = true */ )
{
- std::vector< Reference< chart2::XAxis > > aCatAxes(
+ std::vector< rtl::Reference< Axis > > aCatAxes(
lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
- for (const Reference< chart2::XAxis >& xCatAxis : aCatAxes)
+ for (const rtl::Reference< Axis >& xCatAxis : aCatAxes)
{
if( xCatAxis.is())
{
@@ -787,12 +787,12 @@ uno::Reference< chart2::data::XLabeledDataSequence >
try
{
- std::vector< Reference< chart2::XAxis > > aCatAxes(
+ std::vector< rtl::Reference< Axis > > aCatAxes(
lcl_getAxisHoldingCategoriesFromDiagram( xDiagram ));
//search for first categories
if (!aCatAxes.empty())
{
- Reference< chart2::XAxis > xCatAxis(aCatAxes[0]);
+ rtl::Reference< Axis > xCatAxis(aCatAxes[0]);
if( xCatAxis.is())
{
ScaleData aScaleData( xCatAxis->getScaleData());
commit da7e9f8613f66265bc8822519fa60412cd463917
Author: Noel Grandin <[email protected]>
AuthorDate: Tue Feb 8 20:29:39 2022 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Wed Feb 9 07:34:07 2022 +0100
use more concrete types in chart2, Axis
Change-Id: Iab742573a18384adbd1a397326ca6f4998b45ef3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129689
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git a/chart2/source/view/axes/VAxisBase.cxx
b/chart2/source/view/axes/VAxisBase.cxx
index b225b1f7c0c7..3737237da2d4 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -21,6 +21,7 @@
#include <ShapeFactory.hxx>
#include <ExplicitCategoriesProvider.hxx>
#include "Tickmarks.hxx"
+#include <Axis.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/XAxis.hpp>
@@ -136,11 +137,10 @@ bool VAxisBase::isAnythingToDraw()
if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
return false;
- uno::Reference< beans::XPropertySet > xProps(
m_aAxisProperties.m_xAxisModel, uno::UNO_QUERY );
- if( xProps.is() )
+ if( m_aAxisProperties.m_xAxisModel.is() )
{
bool bShow = false;
- xProps->getPropertyValue( "Show" ) >>= bShow;
+ m_aAxisProperties.m_xAxisModel->getPropertyValue( "Show" ) >>= bShow;
if( !bShow )
return false;
}
diff --git a/chart2/source/view/axes/VAxisProperties.cxx
b/chart2/source/view/axes/VAxisProperties.cxx
index 656612cc67fc..a53c3c656fe6 100644
--- a/chart2/source/view/axes/VAxisProperties.cxx
+++ b/chart2/source/view/axes/VAxisProperties.cxx
@@ -19,6 +19,7 @@
#include "VAxisProperties.hxx"
#include <ViewDefines.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include <ChartModelHelper.hxx>
#include <ExplicitCategoriesProvider.hxx>
@@ -152,7 +153,7 @@ TickmarkProperties
AxisProperties::getBiggestTickmarkProperties()
return aTickmarkProperties;
}
-AxisProperties::AxisProperties( const uno::Reference< XAxis >& xAxisModel
+AxisProperties::AxisProperties( const rtl::Reference< Axis >& xAxisModel
, ExplicitCategoriesProvider*
pExplicitCategoriesProvider )
: m_xAxisModel(xAxisModel)
, m_nDimensionIndex(0)
@@ -240,13 +241,11 @@ void AxisProperties::initAxisPositioning( const
uno::Reference< beans::XProperty
void AxisProperties::init( bool bCartesian )
{
- uno::Reference< beans::XPropertySet > xProp =
- uno::Reference<beans::XPropertySet>::query( m_xAxisModel );
- if( !xProp.is() )
+ if( !m_xAxisModel.is() )
return;
if( m_nDimensionIndex<2 )
- initAxisPositioning( xProp );
+ initAxisPositioning( m_xAxisModel );
ScaleData aScaleData = m_xAxisModel->getScaleData();
if( m_nDimensionIndex==0 )
@@ -294,19 +293,19 @@ void AxisProperties::init( bool bCartesian )
try
{
//init LineProperties
- m_aLineProperties.initFromPropertySet( xProp );
+ m_aLineProperties.initFromPropertySet( m_xAxisModel );
//init display labels
- xProp->getPropertyValue( "DisplayLabels" ) >>= m_bDisplayLabels;
+ m_xAxisModel->getPropertyValue( "DisplayLabels" ) >>= m_bDisplayLabels;
// Init layout strategy hint for axis labels.
// Compatibility option: starting from LibreOffice 5.1 the rotated
// layout is preferred to staggering for axis labels.
- xProp->getPropertyValue( "TryStaggeringFirst" ) >>=
m_bTryStaggeringFirst;
+ m_xAxisModel->getPropertyValue( "TryStaggeringFirst" ) >>=
m_bTryStaggeringFirst;
//init TickmarkProperties
- xProp->getPropertyValue( "MajorTickmarks" ) >>= m_nMajorTickmarks;
- xProp->getPropertyValue( "MinorTickmarks" ) >>= m_nMinorTickmarks;
+ m_xAxisModel->getPropertyValue( "MajorTickmarks" ) >>=
m_nMajorTickmarks;
+ m_xAxisModel->getPropertyValue( "MinorTickmarks" ) >>=
m_nMinorTickmarks;
sal_Int32 nMaxDepth = 0;
if(m_nMinorTickmarks!=0)
@@ -341,22 +340,20 @@ AxisLabelProperties::AxisLabelProperties()
}
-void AxisLabelProperties::init( const uno::Reference< XAxis >& xAxisModel )
+void AxisLabelProperties::init( const rtl::Reference< Axis >& xAxisModel )
{
- uno::Reference< beans::XPropertySet > xProp =
- uno::Reference<beans::XPropertySet>::query( xAxisModel );
- if(!xProp.is())
+ if(!xAxisModel.is())
return;
try
{
- xProp->getPropertyValue( "TextBreak" ) >>= m_bLineBreakAllowed;
- xProp->getPropertyValue( "TextOverlap" ) >>= m_bOverlapAllowed;
- xProp->getPropertyValue( "StackCharacters" ) >>= m_bStackCharacters;
- xProp->getPropertyValue( "TextRotation" ) >>= m_fRotationAngleDegree;
+ xAxisModel->getPropertyValue( "TextBreak" ) >>= m_bLineBreakAllowed;
+ xAxisModel->getPropertyValue( "TextOverlap" ) >>= m_bOverlapAllowed;
+ xAxisModel->getPropertyValue( "StackCharacters" ) >>=
m_bStackCharacters;
+ xAxisModel->getPropertyValue( "TextRotation" ) >>=
m_fRotationAngleDegree;
css::chart::ChartAxisArrangeOrderType eArrangeOrder;
- xProp->getPropertyValue( "ArrangeOrder" ) >>= eArrangeOrder;
+ xAxisModel->getPropertyValue( "ArrangeOrder" ) >>= eArrangeOrder;
switch(eArrangeOrder)
{
case css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE:
diff --git a/chart2/source/view/axes/VAxisProperties.hxx
b/chart2/source/view/axes/VAxisProperties.hxx
index 44778cbf916e..4370ccbb6e65 100644
--- a/chart2/source/view/axes/VAxisProperties.hxx
+++ b/chart2/source/view/axes/VAxisProperties.hxx
@@ -27,6 +27,7 @@
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
#include <com/sun/star/uno/Any.hxx>
+#include <rtl/ref.hxx>
#include <vector>
#include <optional>
@@ -38,6 +39,7 @@ namespace com::sun::star::chart2::data { class
XTextualDataSequence; }
namespace chart
{
+class Axis;
//These properties describe how a couple of labels are arranged one to another.
//The couple can contain all labels for all tickmark depth or just the labels
for one single depth or
@@ -71,7 +73,7 @@ struct AxisLabelProperties final
sal_Int32 m_nRhythm; //show only each nth label with n==nRhythm
//methods:
- void init( const css::uno::Reference< css::chart2::XAxis >& xAxisModel );
+ void init( const rtl::Reference< ::chart::Axis >& xAxisModel );
bool isStaggered() const;
@@ -90,7 +92,7 @@ struct AxisLabelAlignment
struct AxisProperties final
{
- css::uno::Reference<css::chart2::XAxis> m_xAxisModel;
+ rtl::Reference<::chart::Axis> m_xAxisModel;
sal_Int32 m_nDimensionIndex;
bool m_bIsMainAxis;//not secondary axis
@@ -138,7 +140,7 @@ struct AxisProperties final
//methods:
- AxisProperties( const css::uno::Reference< css::chart2::XAxis >& xAxisModel
+ AxisProperties( const rtl::Reference< ::chart::Axis >& xAxisModel
, ExplicitCategoriesProvider* pExplicitCategoriesProvider );
void init(bool bCartesian=false);//init from model data (m_xAxisModel)
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx
b/chart2/source/view/axes/VCartesianAxis.cxx
index 645afcce2cb6..8e7b3a1e728e 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -25,6 +25,7 @@
#include <LabelPositionHelper.hxx>
#include <TrueGuard.hxx>
#include <BaseGFXHelper.hxx>
+#include <Axis.hxx>
#include <AxisHelper.hxx>
#include "Tickmarks_Equidistant.hxx"
#include <ExplicitCategoriesProvider.hxx>
@@ -424,7 +425,7 @@ static void getAxisLabelProperties(
const AxisLabelProperties& rAxisLabelProp,
sal_Int32 nLimitedSpaceForText, bool bLimitedHeight )
{
- Reference<beans::XPropertySet> xProps(rAxisProp.m_xAxisModel,
uno::UNO_QUERY);
+ Reference<beans::XPropertySet> xProps(rAxisProp.m_xAxisModel);
PropertyMapper::getTextLabelMultiPropertyLists(
xProps, rPropNames, rPropValues, false, nLimitedSpaceForText,
bLimitedHeight, false);
diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
index 64d02eb904c0..2b14282cec6c 100644
--- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx
@@ -136,7 +136,7 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.m_bSwapXAndY = bSwapXAndY;
aAxisProperties.m_bIsMainAxis = (nAxisIndex==0);
aAxisProperties.m_bLimitSpaceForLabels = bLimitSpaceForLabels;
- Reference< XAxis > xCrossingMainAxis(
AxisHelper::getCrossingMainAxis( xAxis, m_xCooSysModel ) );
+ rtl::Reference< Axis > xCrossingMainAxis =
AxisHelper::getCrossingMainAxis( xAxis, m_xCooSysModel );
if( xCrossingMainAxis.is() )
{
ScaleData aCrossingScale( xCrossingMainAxis->getScaleData() );
@@ -151,8 +151,8 @@ void VCartesianCoordinateSystem::createVAxisList(
aAxisProperties.m_xAxisTextProvider = new TextualDataProvider(
m_aSeriesNamesForZAxis );
//for the z axis copy the positioning properties from the x
axis (or from the y axis for swapped coordinate systems)
- Reference< XAxis > xSisterAxis(
AxisHelper::getCrossingMainAxis( xCrossingMainAxis, m_xCooSysModel ) );
- aAxisProperties.initAxisPositioning( Reference<
beans::XPropertySet >( xSisterAxis, uno::UNO_QUERY) );
+ rtl::Reference< Axis > xSisterAxis =
AxisHelper::getCrossingMainAxis( xCrossingMainAxis, m_xCooSysModel );
+ aAxisProperties.initAxisPositioning( xSisterAxis );
}
aAxisProperties.init(true);
if(aAxisProperties.m_bDisplayLabels)
diff --git a/chart2/source/view/axes/VPolarAngleAxis.cxx
b/chart2/source/view/axes/VPolarAngleAxis.cxx
index 533ffbc92dd1..224f704eb403 100644
--- a/chart2/source/view/axes/VPolarAngleAxis.cxx
+++ b/chart2/source/view/axes/VPolarAngleAxis.cxx
@@ -22,6 +22,7 @@
#include "VPolarAngleAxis.hxx"
#include "VPolarGrid.hxx"
#include <ShapeFactory.hxx>
+#include <Axis.hxx>
#include <NumberFormatterWrapper.hxx>
#include <PolarLabelPositionHelper.hxx>
#include <PlottingPositionHelper.hxx>
@@ -60,7 +61,7 @@ void VPolarAngleAxis::createTextShapes_ForAngleAxis(
tNameSequence aPropNames;
tAnySequence aPropValues;
- uno::Reference< beans::XPropertySet > xProps(
m_aAxisProperties.m_xAxisModel, uno::UNO_QUERY );
+ uno::Reference< beans::XPropertySet > xProps(
m_aAxisProperties.m_xAxisModel );
PropertyMapper::getTextLabelMultiPropertyLists( xProps, aPropNames,
aPropValues, false, -1, false, false );
LabelPositionHelper::doDynamicFontResize( aPropValues, aPropNames, xProps
, rAxisLabelProperties.m_aFontReferenceSize );
diff --git a/chart2/source/view/axes/VPolarRadiusAxis.cxx
b/chart2/source/view/axes/VPolarRadiusAxis.cxx
index 73e153705db6..f93315410e96 100644
--- a/chart2/source/view/axes/VPolarRadiusAxis.cxx
+++ b/chart2/source/view/axes/VPolarRadiusAxis.cxx
@@ -20,6 +20,7 @@
#include "VPolarRadiusAxis.hxx"
#include "VCartesianAxis.hxx"
#include <PlottingPositionHelper.hxx>
+#include <Axis.hxx>
#include <CommonConverters.hxx>
#include "Tickmarks_Equidistant.hxx"
commit 11c4ec15f13bbcc1b7a85e966519d75e64f62c4a
Author: Noel Grandin <[email protected]>
AuthorDate: Tue Feb 8 20:11:04 2022 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Wed Feb 9 07:32:54 2022 +0100
use more concrete types in chart2, Axis
Change-Id: Ia45eac5e63d4937310a52a88c142623274fd4e1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129688
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx
b/chart2/source/view/axes/VCartesianGrid.cxx
index 19e60b4ecabd..a5c44c22b042 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -161,9 +161,9 @@ static void addLine3D(
std::vector<std::vector<css::drawing::Position3D>>& rPoin
}
VCartesianGrid::VCartesianGrid( sal_Int32 nDimensionIndex, sal_Int32
nDimensionCount
- , const Sequence< Reference<
beans::XPropertySet > > & rGridPropertiesList )
+ , const std::vector< Reference<
beans::XPropertySet > > aGridPropertiesList )
: VAxisOrGridBase( nDimensionIndex, nDimensionCount )
- , m_aGridPropertiesList( rGridPropertiesList )
+ , m_aGridPropertiesList( std::move(aGridPropertiesList) )
{
m_pPosHelper = new PlottingPositionHelper();
}
@@ -175,10 +175,10 @@ VCartesianGrid::~VCartesianGrid()
}
void VCartesianGrid::fillLinePropertiesFromGridModel(
std::vector<VLineProperties>& rLinePropertiesList
- , const Sequence< Reference<
beans::XPropertySet > > & rGridPropertiesList )
+ , const std::vector< Reference<
beans::XPropertySet > > & rGridPropertiesList )
{
rLinePropertiesList.clear();
- if( !rGridPropertiesList.hasElements() )
+ if( rGridPropertiesList.empty() )
return;
VLineProperties aLineProperties;
@@ -194,7 +194,7 @@ void VCartesianGrid::fillLinePropertiesFromGridModel(
std::vector<VLinePropertie
void VCartesianGrid::createShapes()
{
- if(!m_aGridPropertiesList.hasElements())
+ if(m_aGridPropertiesList.empty())
return;
//somehow equal to axis tickmarks
diff --git a/chart2/source/view/axes/VCartesianGrid.hxx
b/chart2/source/view/axes/VCartesianGrid.hxx
index 2302a1d5a69f..81ba1e16f1db 100644
--- a/chart2/source/view/axes/VCartesianGrid.hxx
+++ b/chart2/source/view/axes/VCartesianGrid.hxx
@@ -31,19 +31,19 @@ class VCartesianGrid : public VAxisOrGridBase
// public methods
public:
VCartesianGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > >&
rGridPropertiesList //main grid, subgrid, subsubgrid etc
+ , std::vector<
+ css::uno::Reference< css::beans::XPropertySet > >
aGridPropertiesList //main grid, subgrid, subsubgrid etc
);
virtual ~VCartesianGrid() override;
virtual void createShapes() override;
static void fillLinePropertiesFromGridModel( std::vector<VLineProperties>&
rLinePropertiesList
- , const css::uno::Sequence<
+ , const std::vector<
css::uno::Reference< css::beans::XPropertySet > >&
rGridPropertiesList );
private:
- css::uno::Sequence<
+ std::vector<
css::uno::Reference< css::beans::XPropertySet > >
m_aGridPropertiesList; //main grid, subgrid, subsubgrid etc
};
diff --git a/chart2/source/view/axes/VCoordinateSystem.cxx
b/chart2/source/view/axes/VCoordinateSystem.cxx
index 416112749242..729fb32c8171 100644
--- a/chart2/source/view/axes/VCoordinateSystem.cxx
+++ b/chart2/source/view/axes/VCoordinateSystem.cxx
@@ -193,7 +193,7 @@ rtl::Reference< Axis >
VCoordinateSystem::getAxisByDimension( sal_Int32 nDimensi
return nullptr;
}
-Sequence< Reference< beans::XPropertySet > >
VCoordinateSystem::getGridListFromAxis( const Reference< XAxis >& xAxis )
+std::vector< Reference< beans::XPropertySet > >
VCoordinateSystem::getGridListFromAxis( const rtl::Reference< Axis >& xAxis )
{
std::vector< Reference< beans::XPropertySet > > aRet;
@@ -204,7 +204,7 @@ Sequence< Reference< beans::XPropertySet > >
VCoordinateSystem::getGridListFromA
aRet.insert( aRet.end(), aSubGrids.begin(), aSubGrids.end() );
}
- return comphelper::containerToSequence( aRet );
+ return aRet;
}
void VCoordinateSystem::impl_adjustDimension( sal_Int32& rDimensionIndex )
@@ -568,7 +568,7 @@ void VCoordinateSystem::setSeriesNamesForAxis( const
Sequence< OUString >& rSeri
}
sal_Int32 VCoordinateSystem::getNumberFormatKeyForAxis(
- const Reference< chart2::XAxis >& xAxis
+ const rtl::Reference< Axis >& xAxis
, const rtl::Reference<::chart::ChartModel>& xChartDoc)
{
return ExplicitValueProvider::getExplicitNumberFormatKeyForAxis(
diff --git a/chart2/source/view/axes/VPolarGrid.cxx
b/chart2/source/view/axes/VPolarGrid.cxx
index f64349d97662..e876c83b2de7 100644
--- a/chart2/source/view/axes/VPolarGrid.cxx
+++ b/chart2/source/view/axes/VPolarGrid.cxx
@@ -38,9 +38,9 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
VPolarGrid::VPolarGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const uno::Sequence< Reference< beans::XPropertySet >
> & rGridPropertiesList )
+ , std::vector< Reference< beans::XPropertySet > >
aGridPropertiesList )
: VAxisOrGridBase( nDimensionIndex, nDimensionCount )
- , m_aGridPropertiesList( rGridPropertiesList )
+ , m_aGridPropertiesList( std::move(aGridPropertiesList) )
, m_pPosHelper( new PolarPlottingPositionHelper() )
{
PlotterBase::m_pPosHelper = m_pPosHelper.get();
@@ -220,7 +220,7 @@ void VPolarGrid::createShapes()
OSL_PRECOND(m_xLogicTarget.is()&&m_xFinalTarget.is(),"Axis is not proper
initialized");
if(!(m_xLogicTarget.is()&&m_xFinalTarget.is()))
return;
- if(!m_aGridPropertiesList.hasElements())
+ if(m_aGridPropertiesList.empty())
return;
//create all scaled tickmark values
diff --git a/chart2/source/view/axes/VPolarGrid.hxx
b/chart2/source/view/axes/VPolarGrid.hxx
index c5a9df7bb6e9..9b15d0e5bcbc 100644
--- a/chart2/source/view/axes/VPolarGrid.hxx
+++ b/chart2/source/view/axes/VPolarGrid.hxx
@@ -35,8 +35,8 @@ class VPolarGrid : public VAxisOrGridBase
// public methods
public:
VPolarGrid( sal_Int32 nDimensionIndex, sal_Int32 nDimensionCount
- , const css::uno::Sequence<
- css::uno::Reference< css::beans::XPropertySet > > &
rGridPropertiesList //main grid, subgrid, subsubgrid etc
+ , std::vector<
+ css::uno::Reference< css::beans::XPropertySet > >
aGridPropertiesList //main grid, subgrid, subsubgrid etc
);
virtual ~VPolarGrid() override;
@@ -53,7 +53,7 @@ public:
, double fLogicRadius, double fLogicZ );
private: //member
- css::uno::Sequence<
+ std::vector<
css::uno::Reference< css::beans::XPropertySet > >
m_aGridPropertiesList;//main grid, subgrid, subsubgrid etc
std::unique_ptr<PolarPlottingPositionHelper> m_pPosHelper;
std::vector< ExplicitIncrementData > m_aIncrements;
diff --git a/chart2/source/view/inc/VCoordinateSystem.hxx
b/chart2/source/view/inc/VCoordinateSystem.hxx
index 22b5833fecbf..0664a5462996 100644
--- a/chart2/source/view/inc/VCoordinateSystem.hxx
+++ b/chart2/source/view/inc/VCoordinateSystem.hxx
@@ -143,16 +143,15 @@ protected: //methods
rtl::Reference< ::chart::Axis >
getAxisByDimension( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex )
const;
- static css::uno::Sequence< css::uno::Reference< css::beans::XPropertySet >
>
- getGridListFromAxis( const css::uno::Reference< css::chart2::XAxis >&
xAxis );
+ static std::vector< css::uno::Reference< css::beans::XPropertySet > >
+ getGridListFromAxis( const rtl::Reference< ::chart::Axis >& xAxis );
VAxisBase* getVAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex );
OUString createCIDForAxis( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
);
OUString createCIDForGrid( sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex
);
- sal_Int32 getNumberFormatKeyForAxis( const css::uno::Reference<
- css::chart2::XAxis >& xAxis
+ sal_Int32 getNumberFormatKeyForAxis( const rtl::Reference< ::chart::Axis
>& xAxis
, const rtl::Reference<::chart::ChartModel>& xChartDoc);
private: //methods
commit 6e800111d6daa927564e5f4dba8937bbf56e7b8f
Author: Noel Grandin <[email protected]>
AuthorDate: Tue Feb 8 19:56:39 2022 +0200
Commit: Noel Grandin <[email protected]>
CommitDate: Wed Feb 9 07:32:09 2022 +0100
use more concrete types in chart2, DataSource
Change-Id: I513491e8d39ee79edf8521d279bd32031cf22a93
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129687
Tested-by: Jenkins
Reviewed-by: Noel Grandin <[email protected]>
diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx
b/chart2/source/controller/main/ChartDropTargetHelper.cxx
index dd53e2cf73ea..e4ffd2a29568 100644
--- a/chart2/source/controller/main/ChartDropTargetHelper.cxx
+++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx
@@ -18,6 +18,7 @@
*/
#include "ChartDropTargetHelper.hxx"
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <ChartModel.hxx>
#include <Diagram.hxx>
@@ -125,10 +126,10 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const
ExecuteDropEvent& rEvt )
if( xDataProvider.is() && xDiagram.is() &&
DataSourceHelper::allArgumentsForRectRangeDetected( m_xChartDocument ))
{
- Reference< chart2::data::XDataSource >
xDataSource(
-
DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument ));
+ rtl::Reference< DataSource > xDataSource1 =
+
DataSourceHelper::pressUsedDataIntoRectangularFormat( m_xChartDocument );
Sequence< beans::PropertyValue > aArguments(
- xDataProvider->detectArguments(
xDataSource ));
+ xDataProvider->detectArguments(
xDataSource1 ));
OUString aOldRange;
beans::PropertyValue * pCellRange = nullptr;
@@ -156,8 +157,9 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const
ExecuteDropEvent& rEvt )
pCellRange->Value <<= aRangeString;
}
- xDataSource.set(
xDataProvider->createDataSource( aArguments ));
- xDiagram->setDiagramData( xDataSource,
aArguments );
+ Reference< chart2::data::XDataSource >
xDataSource2 =
+ xDataProvider->createDataSource(
aArguments );
+ xDiagram->setDiagramData( xDataSource2,
aArguments );
// always return copy state to avoid
deletion of the dragged range
nResult = DND_ACTION_COPY;
diff --git a/chart2/source/controller/main/ChartModelClone.cxx
b/chart2/source/controller/main/ChartModelClone.cxx
index dfb089d566e8..d4cae52d0ff6 100644
--- a/chart2/source/controller/main/ChartModelClone.cxx
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -21,6 +21,7 @@
#include <ChartModel.hxx>
#include <ChartModelHelper.hxx>
#include <ControllerLockGuard.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
@@ -201,7 +202,7 @@ namespace chart
if ( i_model->hasInternalDataProvider() )
{
Reference< XInternalDataProvider > xNewDataProvider(
i_model->getDataProvider(), UNO_QUERY );
- Reference< XDataSource > xUsedData(
DataSourceHelper::getUsedData( *i_model ) );
+ rtl::Reference< DataSource > xUsedData =
DataSourceHelper::getUsedData( *i_model );
if ( xUsedData.is() && xNewDataProvider.is() )
{
const Sequence< Reference< XLabeledDataSequence > > aData(
xUsedData->getDataSequences() );
diff --git a/chart2/source/inc/DataSource.hxx b/chart2/source/inc/DataSource.hxx
index e1346fa27e92..1f9478d85653 100644
--- a/chart2/source/inc/DataSource.hxx
+++ b/chart2/source/inc/DataSource.hxx
@@ -24,12 +24,13 @@
#include <cppuhelper/implbase.hxx>
#include <rtl/ref.hxx>
#include <vector>
+#include "charttoolsdllapi.hxx"
namespace chart
{
class LabeledDataSequence;
-class DataSource final : public
+class OOO_DLLPUBLIC_CHARTTOOLS DataSource final : public
::cppu::WeakImplHelper<
css::lang::XServiceInfo,
css::chart2::data::XDataSource,
@@ -49,7 +50,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
override;
-protected:
// ____ XDataSource ____
virtual css::uno::Sequence< css::uno::Reference<
css::chart2::data::XLabeledDataSequence > > SAL_CALL
getDataSequences() override;
diff --git a/chart2/source/inc/DataSourceHelper.hxx
b/chart2/source/inc/DataSourceHelper.hxx
index 561fb5644428..ff64d356e6d0 100644
--- a/chart2/source/inc/DataSourceHelper.hxx
+++ b/chart2/source/inc/DataSourceHelper.hxx
@@ -42,10 +42,6 @@ class LabeledDataSequence;
class OOO_DLLPUBLIC_CHARTTOOLS DataSourceHelper
{
public:
- static rtl::Reference< ::chart::DataSource >
- createDataSource( const css::uno::Sequence<
- css::uno::Reference< css::chart2::data::XLabeledDataSequence
> > & rSequences );
-
static css::uno::Reference< css::chart2::data::XDataSequence >
createCachedDataSequence();
@@ -78,7 +74,7 @@ public:
, OUString & rRangeRepresentation, css::uno::Sequence< sal_Int32
>& rSequenceMapping
, bool& bUseColumns, bool& bFirstCellAsLabel, bool& bHasCategories
);
- static css::uno::Reference< css::chart2::data::XDataSource >
+ static rtl::Reference< ::chart::DataSource >
pressUsedDataIntoRectangularFormat( const rtl::Reference<
::chart::ChartModel >& xChartDoc );
SAL_DLLPRIVATE static css::uno::Sequence< OUString > getUsedDataRanges(
@@ -87,10 +83,10 @@ public:
static css::uno::Sequence< OUString > getUsedDataRanges(
const rtl::Reference<::chart::ChartModel> & xChartModel );
- static css::uno::Reference< css::chart2::data::XDataSource >
getUsedData(
+ static rtl::Reference< ::chart::DataSource > getUsedData(
ChartModel& rModel );
- static css::uno::Reference< css::chart2::data::XDataSource >
getUsedData(
+ static rtl::Reference< ::chart::DataSource > getUsedData(
const rtl::Reference<::chart::ChartModel>& xChartModel );
static bool detectRangeSegmentation(
diff --git a/chart2/source/model/main/ChartModel.cxx
b/chart2/source/model/main/ChartModel.cxx
index 9f22619448f2..78ed71f1830e 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -21,6 +21,7 @@
#include <ChartTypeManager.hxx>
#include <ChartTypeTemplate.hxx>
#include <servicenames.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <ChartModelHelper.hxx>
#include <DisposeHelper.hxx>
@@ -1246,8 +1247,7 @@ void SAL_CALL ChartModel::setParent( const Reference<
uno::XInterface >& Parent
// ____ XDataSource ____
uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL
ChartModel::getDataSequences()
{
- Reference< chart2::data::XDataSource > xSource(
- DataSourceHelper::getUsedData( *this ) );
+ rtl::Reference< DataSource > xSource = DataSourceHelper::getUsedData(
*this );
if( xSource.is())
return xSource->getDataSequences();
diff --git a/chart2/source/model/template/DataInterpreter.cxx
b/chart2/source/model/template/DataInterpreter.cxx
index b374cae93cc6..4d45d2a58278 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -285,7 +285,7 @@ rtl::Reference< DataSource >
DataInterpreter::mergeInterpretedData(
}
}
- return DataSourceHelper::createDataSource(
comphelper::containerToSequence( aResultVec ) );
+ return new DataSource(aResultVec);
}
uno::Any DataInterpreter::getChartTypeSpecificData(
diff --git a/chart2/source/tools/AxisHelper.cxx
b/chart2/source/tools/AxisHelper.cxx
index 258f8d384dc2..2418ca2097b0 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -24,6 +24,7 @@
#include <ChartType.hxx>
#include <Axis.hxx>
#include <AxisIndexDefines.hxx>
+#include <DataSource.hxx>
#include <LabeledDataSequence.hxx>
#include <LinePropertiesHelper.hxx>
#include <servicenames_coosystems.hxx>
@@ -209,7 +210,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis(
}
else
{
- Reference< data::XDataSource > xSource(
DataSourceHelper::getUsedData( *xChartDoc ) );
+ rtl::Reference< DataSource > xSource =
DataSourceHelper::getUsedData( *xChartDoc );
if( xSource.is() )
{
std::vector< uno::Reference<
chart2::data::XLabeledDataSequence > > aXValues(
diff --git a/chart2/source/tools/ChartModelHelper.cxx
b/chart2/source/tools/ChartModelHelper.cxx
index fbce1d27f149..e13ce8497b03 100644
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
@@ -20,6 +20,7 @@
#include <ChartModelHelper.hxx>
#include <DiagramHelper.hxx>
#include <Diagram.hxx>
+#include <DataSource.hxx>
#include <DataSourceHelper.hxx>
#include <ControllerLockGuard.hxx>
#include <RangeHighlighter.hxx>
@@ -217,7 +218,7 @@ bool ChartModelHelper::setIncludeHiddenCells( bool
bIncludeHiddenCells, ChartMod
try
{
- uno::Reference< chart2::data::XDataSource > xUsedData(
DataSourceHelper::getUsedData( rModel ) );
+ rtl::Reference< DataSource > xUsedData =
DataSourceHelper::getUsedData( rModel );
if( xUsedData.is() )
{
uno::Reference< beans::XPropertySet > xProp;
diff --git a/chart2/source/tools/DataSourceHelper.cxx
b/chart2/source/tools/DataSourceHelper.cxx
index dc13e7f8e29d..f3146961b4c9 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -117,12 +117,6 @@ void lcl_addErrorBarRanges(
} // anonymous namespace
-rtl::Reference< ::chart::DataSource > DataSourceHelper::createDataSource(
- const Sequence< Reference< chart2::data::XLabeledDataSequence > >&
rSequences )
-{
- return new DataSource(rSequences);
-}
-
Reference< chart2::data::XDataSequence >
DataSourceHelper::createCachedDataSequence()
{
return new ::chart::CachedDataSequence();
@@ -219,7 +213,7 @@ void DataSourceHelper::readArguments( const uno::Sequence<
beans::PropertyValue
}
}
-uno::Reference< chart2::data::XDataSource >
DataSourceHelper::pressUsedDataIntoRectangularFormat(
+rtl::Reference< DataSource >
DataSourceHelper::pressUsedDataIntoRectangularFormat(
const rtl::Reference< ChartModel >& xChartDoc )
{
std::vector< Reference< chart2::data::XLabeledDataSequence > >
aResultVector;
@@ -250,7 +244,7 @@ uno::Reference< chart2::data::XDataSource >
DataSourceHelper::pressUsedDataIntoR
aResultVector.push_back( labeledData );
}
- return new DataSource( comphelper::containerToSequence(aResultVector) );
+ return new DataSource( aResultVector );
}
uno::Sequence< OUString > DataSourceHelper::getUsedDataRanges(
@@ -281,13 +275,13 @@ uno::Sequence< OUString >
DataSourceHelper::getUsedDataRanges( const rtl::Refere
return getUsedDataRanges( xDiagram );
}
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
+rtl::Reference< DataSource > DataSourceHelper::getUsedData(
const rtl::Reference<::chart::ChartModel>& xChartDoc )
{
return pressUsedDataIntoRectangularFormat( xChartDoc );
}
-uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
+rtl::Reference< DataSource > DataSourceHelper::getUsedData(
ChartModel& rModel )
{
std::vector< uno::Reference< chart2::data::XLabeledDataSequence > >
aResult;
commit 425ff2e7911436cf2a20d5640d87274d2467b7c0
Author: Michael Weghorn <[email protected]>
AuthorDate: Tue Feb 8 16:44:02 2022 +0100
Commit: Michael Weghorn <[email protected]>
CommitDate: Wed Feb 9 07:23:33 2022 +0100
sw a11y: Drop custom implementations of std::less
SwFrameFunc's operator() just applied the less-than operator
which is the same as 'std::less<const SwFrame*>' does.
The latter is the default for the 'Compare' template argument of a
'std::map' with key type 'const SwFrame*>' anyway, so
there's no need to specify any explicitly.
The same applies for 'SwShapeFunc' accordingly.
Change-Id: I2472b38d04dd6d280bfb825d750a6d67c2d9797c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129682
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <[email protected]>
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 439749f900bf..7704b16f3e52 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -82,29 +82,16 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using namespace ::sw::access;
-namespace {
-
-struct SwFrameFunc
-{
- bool operator()( const SwFrame * p1, const SwFrame * p2) const
- {
- return p1 < p2;
- }
-};
-
-}
-
class SwAccessibleContextMap_Impl
{
public:
typedef const SwFrame *
key_type;
typedef uno::WeakReference < XAccessible >
mapped_type;
typedef std::pair<const key_type,mapped_type>
value_type;
- typedef SwFrameFunc
key_compare;
- typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
- typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
+ typedef std::map<key_type, mapped_type>::iterator iterator;
+ typedef std::map<key_type, mapped_type>::const_iterator const_iterator;
private:
- std::map <key_type,mapped_type,key_compare> maMap;
+ std::map <key_type, mapped_type> maMap;
public:
#if OSL_DEBUG_LEVEL > 0
@@ -257,18 +244,6 @@ void SwDrawModellListener_Impl::Dispose()
mpDrawModel = nullptr;
}
-namespace {
-
-struct SwShapeFunc
-{
- bool operator()( const SdrObject * p1, const SdrObject * p2) const
- {
- return p1 < p2;
- }
-};
-
-}
-
typedef std::pair < const SdrObject *, ::rtl::Reference <
::accessibility::AccessibleShape > > SwAccessibleObjShape_Impl;
class SwAccessibleShapeMap_Impl
@@ -278,14 +253,13 @@ public:
typedef const SdrObject *
key_type;
typedef uno::WeakReference<XAccessible>
mapped_type;
typedef std::pair<const key_type,mapped_type>
value_type;
- typedef SwShapeFunc
key_compare;
- typedef std::map<key_type,mapped_type,key_compare>::iterator
iterator;
- typedef std::map<key_type,mapped_type,key_compare>::const_iterator
const_iterator;
+ typedef std::map<key_type, mapped_type>::iterator iterator;
+ typedef std::map<key_type, mapped_type>::const_iterator const_iterator;
private:
::accessibility::AccessibleShapeTreeInfo maInfo;
- std::map<key_type,mapped_type,SwShapeFunc> maMap;
+ std::map<key_type, mapped_type> maMap;
public:
commit 3e5e0c2943e057873952b5394b81dbe6d29ef1e2
Author: Jeff Huang <[email protected]>
AuthorDate: Mon Feb 7 15:06:46 2022 +0800
Commit: Heiko Tietze <[email protected]>
CommitDate: Wed Feb 9 07:12:58 2022 +0100
tdf#146937 Remove "refresh" command from Template Manager
Change-Id: I12b43c10cca455a6885101909327b81940dafb07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129584
Reviewed-by: Heiko Tietze <[email protected]>
Tested-by: Jenkins
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 010b3497b089..a55424982dda 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -58,7 +58,6 @@
#define STR_QRYTEMPL_MESSAGE NC_("STR_QRYTEMPL_MESSAGE",
"The template '$(ARG1)' on which this document is based, has been modified. Do
you want to update the styles of the current document, using the modified
template?")
#define STR_QRYTEMPL_UPDATE_BTN NC_("STR_QRYTEMPL_UPDATE_BTN",
"~Update Styles")
#define STR_QRYTEMPL_KEEP_BTN NC_("STR_QRYTEMPL_KEEP_BTN",
"~Keep Old Styles")
-#define STR_ACTION_REFRESH NC_("STR_ACTION_REFRESH",
"~Refresh")
#define STR_CATEGORY_NEW NC_("STR_CATEGORY_NEW", "~New
Category")
#define STR_CATEGORY_DELETE NC_("STR_CATEGORY_DELETE",
"~Delete Category")
#define STR_MSG_EXPORT_SUCCESS NC_("STR_MSG_EXPORT_SUCCESS",
"$1 templates successfully exported.")
diff --git a/sfx2/inc/bitmaps.hlst b/sfx2/inc/bitmaps.hlst
index f48563d83fe9..c3fb205bb7bb 100644
--- a/sfx2/inc/bitmaps.hlst
+++ b/sfx2/inc/bitmaps.hlst
@@ -56,7 +56,6 @@ inline constexpr OUStringLiteral SFX_THUMBNAIL_BASE_256 =
u"res/base_thumbnail_2
inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE =
u"res/recentdoc_remove.png";
inline constexpr OUStringLiteral BMP_RECENTDOC_REMOVE_HIGHLIGHTED =
u"res/recentdoc_remove_highlighted.png";
inline constexpr OUStringLiteral BMP_DEFAULT = u"res/templatestar.png";
-inline constexpr OUStringLiteral BMP_ACTION_REFRESH = u"res/reload.png";
inline constexpr OUStringLiteral BMP_128X128_CALC_DOC =
u"sfx2/res/128x128_calc_doc-p.png";
inline constexpr OUStringLiteral BMP_128X128_DRAW_DOC =
u"sfx2/res/128x128_draw_doc-p.png";
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 0561c5f380dc..37187ffbc691 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -63,7 +63,6 @@ constexpr OUStringLiteral TM_SETTING_VIEWMODE = u"ViewMode";
#define MNI_ACTION_NEW_FOLDER "new"
#define MNI_ACTION_RENAME_FOLDER "rename"
#define MNI_ACTION_DELETE_FOLDER "delete"
-#define MNI_ACTION_REFRESH "refresh"
#define MNI_ACTION_DEFAULT "default"
#define MNI_ACTION_DEFAULT_WRITER "default_writer"
#define MNI_ACTION_DEFAULT_CALC "default_calc"
@@ -178,7 +177,6 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg(weld::Window
*pParent)
mxActionBar->append_item(MNI_ACTION_RENAME_FOLDER,
SfxResId(STR_CATEGORY_RENAME), BMP_ACTION_RENAME);
mxActionBar->append_item(MNI_ACTION_DELETE_FOLDER,
SfxResId(STR_CATEGORY_DELETE), BMP_ACTION_DELETE_CATEGORY);
mxActionBar->append_separator("separator");
- mxActionBar->append_item(MNI_ACTION_REFRESH, SfxResId(STR_ACTION_REFRESH),
BMP_ACTION_REFRESH);
mxActionBar->append_item(MNI_ACTION_DEFAULT,
SfxResId(STR_ACTION_RESET_ALL_DEFAULT_TEMPLATES));
mxActionBar->append_item(MNI_ACTION_DEFAULT_WRITER,
SfxResId(STR_ACTION_RESET_WRITER_TEMPLATE), BMP_ACTION_DEFAULT_WRITER);
mxActionBar->append_item(MNI_ACTION_DEFAULT_CALC,
SfxResId(STR_ACTION_RESET_CALC_TEMPLATE), BMP_ACTION_DEFAULT_CALC);
@@ -517,11 +515,6 @@ IMPL_LINK(SfxTemplateManagerDlg, MenuSelectHdl, const
OString&, rIdent, void)
OnCategoryRename();
else if (rIdent == MNI_ACTION_DELETE_FOLDER)
OnCategoryDelete();
- else if (rIdent == MNI_ACTION_REFRESH)
- {
- mxLocalView->reload();
- SearchUpdate();
- }
else if (rIdent == MNI_ACTION_DEFAULT)
{
DefaultTemplateMenuSelectHdl(MNI_ACTION_DEFAULT_WRITER);
commit 4e0ba699ab3ba0294acd2589507b50fab82c98f5
Author: Mike Kaganski <[email protected]>
AuthorDate: Tue Feb 8 18:21:22 2022 +0300
Commit: Mike Kaganski <[email protected]>
CommitDate: Wed Feb 9 06:11:39 2022 +0100
Simplify SvGlobalName
Its data only takes 16 bytes, the same as std::string_view on 64-bit
platforms, which is considered trivial. No need to use cow_wrapper
that would itself take 8 bytes, and have the performance penalty.
Also reuse the conversion to sequence from comphelper.
Change-Id: I3e3177ea759bf22d099aaa5402559196c5934ee0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129679
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <[email protected]>
diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx
index 88a5e492d923..8ff2a8b28220 100644
--- a/include/tools/globname.hxx
+++ b/include/tools/globname.hxx
@@ -21,7 +21,6 @@
#include <tools/toolsdllapi.h>
#include <com/sun/star/uno/Sequence.hxx>
-#include <o3tl/cow_wrapper.hxx>
struct SAL_WARN_UNUSED SvGUID
{
@@ -31,39 +30,13 @@ struct SAL_WARN_UNUSED SvGUID
sal_uInt8 Data4[8];
};
-struct SAL_WARN_UNUSED ImpSvGlobalName
-{
- struct SvGUID szData = {};
-
- ImpSvGlobalName(const SvGUID &rData)
- : szData(rData)
- {
- }
- ImpSvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
- sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
- sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14, sal_uInt8 b15);
- ImpSvGlobalName( const ImpSvGlobalName & rObj );
- ImpSvGlobalName() = default;
-
- bool operator == ( const ImpSvGlobalName & rObj ) const;
-};
-
class SvStream;
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC SvGlobalName
{
- ::o3tl::cow_wrapper< ImpSvGlobalName > pImp;
-
public:
- SvGlobalName();
- SvGlobalName( const SvGlobalName & rObj ) :
- pImp( rObj.pImp )
- {
- }
- SvGlobalName( SvGlobalName && rObj ) noexcept :
- pImp( std::move(rObj.pImp) )
- {
- }
+ SvGlobalName() = default;
+ SvGlobalName(const SvGlobalName& rObj) = default;
SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8 b11,
@@ -74,9 +47,7 @@ public:
SvGlobalName( const SvGUID & rId );
- SvGlobalName & operator = ( const SvGlobalName & rObj );
- SvGlobalName & operator = ( SvGlobalName && rObj ) noexcept;
- ~SvGlobalName();
+ SvGlobalName & operator = ( const SvGlobalName & rObj ) = default;
TOOLS_DLLPUBLIC friend SvStream & operator >> ( SvStream &, SvGlobalName &
);
TOOLS_DLLPUBLIC friend SvStream & WriteSvGlobalName( SvStream &, const
SvGlobalName & );
@@ -91,11 +62,14 @@ public:
bool MakeId( const OUString & rId );
OUString GetHexName() const;
- const SvGUID& GetCLSID() const { return pImp->szData; }
+ const SvGUID& GetCLSID() const { return m_aData; }
// platform independent representation of a "GlobalName"
// maybe transported remotely
css::uno::Sequence < sal_Int8 > GetByteSequence() const;
+
+private:
+ SvGUID m_aData = {};
};
#endif
diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx
index fda6fafab53c..87bb46d50c2b 100644
--- a/tools/source/ref/globname.cxx
+++ b/tools/source/ref/globname.cxx
@@ -20,134 +20,81 @@
#include <stdio.h>
#include <string.h>
+#include <comphelper/mimeconfighelper.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/character.hxx>
#include <tools/stream.hxx>
#include <tools/globname.hxx>
-// ImpSvGlobalName ------------------------------------------------------------
-ImpSvGlobalName::ImpSvGlobalName( const ImpSvGlobalName & rObj )
- : szData(rObj.szData)
-{
-}
-
-ImpSvGlobalName::ImpSvGlobalName(sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
- sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10, sal_uInt8
b11,
- sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14,
sal_uInt8 b15)
-{
- szData.Data1 = n1;
- szData.Data2 = n2;
- szData.Data3 = n3;
- szData.Data4[0] = b8;
- szData.Data4[1] = b9;
- szData.Data4[2] = b10;
- szData.Data4[3] = b11;
- szData.Data4[4] = b12;
- szData.Data4[5] = b13;
- szData.Data4[6] = b14;
- szData.Data4[7] = b15;
-}
-
-bool ImpSvGlobalName::operator == ( const ImpSvGlobalName & rObj ) const
-{
- return !memcmp( &szData, &rObj.szData, sizeof( szData ) );
-}
-
// SvGlobalName
----------------------------------------------------------------
-SvGlobalName::SvGlobalName()
-{
-}
-
SvGlobalName::SvGlobalName( const SvGUID & rId ) :
- pImp( ImpSvGlobalName( rId ) )
+ m_aData( rId )
{
}
SvGlobalName::SvGlobalName( sal_uInt32 n1, sal_uInt16 n2, sal_uInt16 n3,
sal_uInt8 b8, sal_uInt8 b9, sal_uInt8 b10,
sal_uInt8 b11,
sal_uInt8 b12, sal_uInt8 b13, sal_uInt8 b14,
sal_uInt8 b15 ) :
- pImp( ImpSvGlobalName(n1, n2, n3, b8, b9, b10, b11, b12, b13, b14, b15) )
+ m_aData{ n1, n2, n3, { b8, b9, b10, b11, b12, b13, b14, b15 } }
{
}
SvGlobalName::SvGlobalName( const css::uno::Sequence < sal_Int8 >& aSeq )
{
// create SvGlobalName from a platform independent representation
- SvGUID aResult = {};
if ( aSeq.getLength() == 16 )
{
- aResult.Data1 = ( ( ( ( ( static_cast<sal_uInt8>(aSeq[0]) << 8 ) +
static_cast<sal_uInt8>(aSeq[1]) ) << 8 ) + static_cast<sal_uInt8>(aSeq[2]) ) <<
8 ) + static_cast<sal_uInt8>(aSeq[3]);
- aResult.Data2 = ( static_cast<sal_uInt8>(aSeq[4]) << 8 ) +
static_cast<sal_uInt8>(aSeq[5]);
- aResult.Data3 = ( static_cast<sal_uInt8>(aSeq[6]) << 8 ) +
static_cast<sal_uInt8>(aSeq[7]);
+ m_aData.Data1 = ( ( ( ( ( static_cast<sal_uInt8>(aSeq[0]) << 8 ) +
static_cast<sal_uInt8>(aSeq[1]) ) << 8 ) + static_cast<sal_uInt8>(aSeq[2]) ) <<
8 ) + static_cast<sal_uInt8>(aSeq[3]);
+ m_aData.Data2 = ( static_cast<sal_uInt8>(aSeq[4]) << 8 ) +
static_cast<sal_uInt8>(aSeq[5]);
+ m_aData.Data3 = ( static_cast<sal_uInt8>(aSeq[6]) << 8 ) +
static_cast<sal_uInt8>(aSeq[7]);
for( int nInd = 0; nInd < 8; nInd++ )
- aResult.Data4[nInd] = static_cast<sal_uInt8>(aSeq[nInd+8]);
+ m_aData.Data4[nInd] = static_cast<sal_uInt8>(aSeq[nInd+8]);
}
-
- pImp = ::o3tl::cow_wrapper< ImpSvGlobalName >(aResult);
-}
-
-SvGlobalName::~SvGlobalName()
-{
-}
-
-SvGlobalName & SvGlobalName::operator = ( const SvGlobalName & rObj )
-{
- pImp = rObj.pImp;
-
- return *this;
-}
-
-SvGlobalName & SvGlobalName::operator = ( SvGlobalName && rObj ) noexcept
-{
- pImp = std::move(rObj.pImp);
- return *this;
}
SvStream& WriteSvGlobalName( SvStream& rOStr, const SvGlobalName & rObj )
{
- rOStr.WriteUInt32( rObj.pImp->szData.Data1 );
- rOStr.WriteUInt16( rObj.pImp->szData.Data2 );
- rOStr.WriteUInt16( rObj.pImp->szData.Data3 );
- rOStr.WriteBytes( &rObj.pImp->szData.Data4, 8 );
+ rOStr.WriteUInt32( rObj.m_aData.Data1 );
+ rOStr.WriteUInt16( rObj.m_aData.Data2 );
+ rOStr.WriteUInt16( rObj.m_aData.Data3 );
+ rOStr.WriteBytes( &rObj.m_aData.Data4, 8 );
return rOStr;
}
SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj )
{
- // the non-const dereferencing operator
- // ensures pImp is unique
- rStr.ReadUInt32( rObj.pImp->szData.Data1 );
- rStr.ReadUInt16( rObj.pImp->szData.Data2 );
- rStr.ReadUInt16( rObj.pImp->szData.Data3 );
- rStr.ReadBytes( &rObj.pImp->szData.Data4, 8 );
+ rStr.ReadUInt32( rObj.m_aData.Data1 );
+ rStr.ReadUInt16( rObj.m_aData.Data2 );
+ rStr.ReadUInt16( rObj.m_aData.Data3 );
+ rStr.ReadBytes( &rObj.m_aData.Data4, 8 );
return rStr;
}
bool SvGlobalName::operator < ( const SvGlobalName & rObj ) const
{
- if( pImp->szData.Data3 < rObj.pImp->szData.Data3 )
+ if( m_aData.Data3 < rObj.m_aData.Data3 )
return true;
- else if( pImp->szData.Data3 > rObj.pImp->szData.Data3 )
+ else if( m_aData.Data3 > rObj.m_aData.Data3 )
return false;
- if( pImp->szData.Data2 < rObj.pImp->szData.Data2 )
+ if( m_aData.Data2 < rObj.m_aData.Data2 )
return true;
- else if( pImp->szData.Data2 > rObj.pImp->szData.Data2 )
+ else if( m_aData.Data2 > rObj.m_aData.Data2 )
return false;
- return pImp->szData.Data1 < rObj.pImp->szData.Data1;
+ return m_aData.Data1 < rObj.m_aData.Data1;
}
bool SvGlobalName::operator == ( const SvGlobalName & rObj ) const
{
- return pImp == rObj.pImp;
+ return memcmp(&m_aData, &rObj.m_aData, sizeof(m_aData)) == 0;
}
void SvGlobalName::MakeFromMemory( void const * pData )
{
- memcpy( &pImp->szData, pData, sizeof( pImp->szData ) );
+ memcpy( &m_aData, pData, sizeof( m_aData ) );
}
bool SvGlobalName::MakeId( const OUString & rIdStr )
@@ -157,57 +104,48 @@ bool SvGlobalName::MakeId( const OUString & rIdStr )
&& '-' == pStr[ 8 ] && '-' == pStr[ 13 ]
&& '-' == pStr[ 18 ] && '-' == pStr[ 23 ] )
{
- sal_uInt32 nFirst = 0;
- int i = 0;
- for( i = 0; i < 8; i++ )
+ SvGUID aGuid = {};
+ auto asciiHexDigitToNumber = [](sal_Unicode c) -> sal_uInt8
+ {
+ if (rtl::isAsciiDigit(c))
+ return c - '0';
+ else
+ return rtl::toAsciiUpperCase(c) - 'A' + 10;
+ };
+ for( int i = 0; i < 8; i++ )
{
if( rtl::isAsciiHexDigit( *pStr ) )
- if( rtl::isAsciiDigit( *pStr ) )
- nFirst = nFirst * 16 + (*pStr - '0');
- else
- nFirst = nFirst * 16 + (rtl::toAsciiUpperCase( *pStr ) -
'A' + 10 );
+ aGuid.Data1 = aGuid.Data1 * 16 + asciiHexDigitToNumber( *pStr
);
else
return false;
pStr++;
}
- sal_uInt16 nSec = 0;
pStr++;
- for( i = 0; i < 4; i++ )
+ for( int i = 0; i < 4; i++ )
{
if( rtl::isAsciiHexDigit( *pStr ) )
- if( rtl::isAsciiDigit( *pStr ) )
- nSec = nSec * 16 + (*pStr - '0');
- else
- nSec = nSec * 16 +
static_cast<sal_uInt16>(rtl::toAsciiUpperCase( *pStr ) - 'A' + 10 );
+ aGuid.Data2 = aGuid.Data2 * 16 + asciiHexDigitToNumber( *pStr
);
else
return false;
pStr++;
}
- sal_uInt16 nThird = 0;
pStr++;
- for( i = 0; i < 4; i++ )
+ for( int i = 0; i < 4; i++ )
{
if( rtl::isAsciiHexDigit( *pStr ) )
- if( rtl::isAsciiDigit( *pStr ) )
- nThird = nThird * 16 + (*pStr - '0');
- else
- nThird = nThird * 16 +
static_cast<sal_uInt16>(rtl::toAsciiUpperCase( *pStr ) - 'A' + 10 );
+ aGuid.Data3 = aGuid.Data3 * 16 + asciiHexDigitToNumber( *pStr
);
else
return false;
pStr++;
}
- sal_Int8 szRemain[ 8 ] = {};
pStr++;
- for( i = 0; i < 16; i++ )
+ for( int i = 0; i < 16; i++ )
{
if( rtl::isAsciiHexDigit( *pStr ) )
- if( rtl::isAsciiDigit( *pStr ) )
- szRemain[i/2] = szRemain[i/2] * 16 + (*pStr - '0');
- else
- szRemain[i/2] = szRemain[i/2] * 16 +
static_cast<sal_Int8>(rtl::toAsciiUpperCase( *pStr ) - 'A' + 10 );
+ aGuid.Data4[i/2] = aGuid.Data4[i/2] * 16 +
asciiHexDigitToNumber( *pStr );
else
return false;
pStr++;
@@ -215,10 +153,7 @@ bool SvGlobalName::MakeId( const OUString & rIdStr )
pStr++;
}
- memcpy(&pImp->szData.Data1, &nFirst, sizeof(nFirst));
- memcpy(&pImp->szData.Data2, &nSec, sizeof(nSec));
- memcpy(&pImp->szData.Data3, &nThird, sizeof(nThird));
- memcpy(&pImp->szData.Data4, szRemain, 8);
+ m_aData = aGuid;
return true;
}
return false;
@@ -229,24 +164,24 @@ OUString SvGlobalName::GetHexName() const
OStringBuffer aHexBuffer(36);
char buf[ 10 ];
- sprintf( buf, "%8.8" SAL_PRIXUINT32, pImp->szData.Data1 );
+ sprintf( buf, "%8.8" SAL_PRIXUINT32, m_aData.Data1 );
aHexBuffer.append(buf);
aHexBuffer.append('-');
- sprintf( buf, "%4.4X", pImp->szData.Data2 );
+ sprintf( buf, "%4.4X", m_aData.Data2 );
aHexBuffer.append(buf);
aHexBuffer.append('-');
- sprintf( buf, "%4.4X", pImp->szData.Data3 );
+ sprintf( buf, "%4.4X", m_aData.Data3 );
aHexBuffer.append(buf);
aHexBuffer.append('-');
for( int i = 0; i < 2; i++ )
{
- sprintf( buf, "%2.2x", pImp->szData.Data4[ i ] );
+ sprintf( buf, "%2.2x", m_aData.Data4[ i ] );
aHexBuffer.append(buf);
}
aHexBuffer.append('-');
for( int i = 2; i < 8; i++ )
{
- sprintf( buf, "%2.2x", pImp->szData.Data4[ i ] );
+ sprintf( buf, "%2.2x", m_aData.Data4[ i ] );
aHexBuffer.append(buf);
}
return OStringToOUString(aHexBuffer.makeStringAndClear(),
RTL_TEXTENCODING_ASCII_US);
@@ -256,26 +191,10 @@ css::uno::Sequence < sal_Int8 >
SvGlobalName::GetByteSequence() const
{
// platform independent representation of a "GlobalName"
// maybe transported remotely
- css::uno::Sequence< sal_Int8 > aResult{
- /* [ 0] */ static_cast<sal_Int8>(pImp->szData.Data1 >> 24),
- /* [ 1] */ static_cast<sal_Int8>((pImp->szData.Data1 << 8 ) >> 24),
- /* [ 2] */ static_cast<sal_Int8>((pImp->szData.Data1 << 16 ) >> 24),
- /* [ 3] */ static_cast<sal_Int8>((pImp->szData.Data1 << 24 ) >> 24),
- /* [ 4] */ static_cast<sal_Int8>(pImp->szData.Data2 >> 8),
- /* [ 5] */ static_cast<sal_Int8>((pImp->szData.Data2 << 8 ) >> 8),
- /* [ 6] */ static_cast<sal_Int8>(pImp->szData.Data3 >> 8),
- /* [ 7] */ static_cast<sal_Int8>((pImp->szData.Data3 << 8 ) >> 8),
- /* [ 8] */ static_cast<sal_Int8>(pImp->szData.Data4[ 0 ]),
- /* [ 9] */ static_cast<sal_Int8>(pImp->szData.Data4[ 1 ]),
- /* [10] */ static_cast<sal_Int8>(pImp->szData.Data4[ 2 ]),
- /* [11] */ static_cast<sal_Int8>(pImp->szData.Data4[ 3 ]),
- /* [12] */ static_cast<sal_Int8>(pImp->szData.Data4[ 4 ]),
- /* [13] */ static_cast<sal_Int8>(pImp->szData.Data4[ 5 ]),
- /* [14] */ static_cast<sal_Int8>(pImp->szData.Data4[ 6 ]),
- /* [15] */ static_cast<sal_Int8>(pImp->szData.Data4[ 7 ])
- };
-
- return aResult;
+ return comphelper::MimeConfigurationHelper::GetSequenceClassID(
+ m_aData.Data1, m_aData.Data2, m_aData.Data3,
+ m_aData.Data4[0], m_aData.Data4[1], m_aData.Data4[2], m_aData.Data4[3],
+ m_aData.Data4[4], m_aData.Data4[5], m_aData.Data4[6],
m_aData.Data4[7]);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 42c5506a9e9ef58efd8193a193464e3b49d481ca
Author: Vasily Melenchuk <[email protected]>
AuthorDate: Mon Feb 7 14:31:02 2022 +0300
Commit: Thorsten Behrens <[email protected]>
CommitDate: Wed Feb 9 00:54:56 2022 +0100
docx import: right margin was not respected for para with list
If paragpraph has list defined somewhere in styles and right
margin defined in current style this margin was overriden with
older value from parent styles.
Change-Id: Ic0a2e9a1ce5f77b9ef38c549a62f1494c050982c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129595
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <[email protected]>
diff --git a/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx
b/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx
new file mode 100644
index 000000000000..975b598f476e
Binary files /dev/null and
b/sw/qa/extras/ooxmlexport/data/testParaListRightIndent.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index f3ed7d2127da..5de93edd3226 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -90,6 +90,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
CPPUNIT_ASSERT_EQUAL(OUString("FF0000"), sColor);
}
+DECLARE_OOXMLEXPORT_TEST(testParaListRightIndent,
"testParaListRightIndent.docx")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2000),
getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(5001),
getProperty<sal_Int32>(getParagraph(2), "ParaRightMargin"));
+}
+
CPPUNIT_TEST_FIXTURE(Test, testDontAddNewStyles)
{
// Given a document that lacks builtin styles, and addition of them is
disabled:
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 99aefa3b1b09..a6694da7f3fa 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1745,6 +1745,10 @@ void DomainMapper_Impl::finishParagraph( const
PropertyMapPtr& pPropertyMap, con
if (nParaLeftMargin != 0)
pParaContext->Insert(PROP_PARA_LEFT_MARGIN,
uno::makeAny(nParaLeftMargin), /*bOverwrite=*/false);
+ // Override right margin value with value from current style,
if any
+ if (pStyleSheetProperties &&
pStyleSheetProperties->isSet(PROP_PARA_RIGHT_MARGIN))
+ nParaRightMargin =
pStyleSheetProperties->getProperty(PROP_PARA_RIGHT_MARGIN)->second.get<sal_Int32>();
+
pParaContext->Insert(PROP_PARA_RIGHT_MARGIN,
uno::makeAny(nParaRightMargin), /*bOverwrite=*/false);
}
}
commit a45f057d9d2bcd28e6b4342bbdf45fec38a43ac1
Author: Stephan Bergmann <[email protected]>
AuthorDate: Tue Feb 8 20:57:10 2022 +0100
Commit: Stephan Bergmann <[email protected]>
CommitDate: Tue Feb 8 23:55:50 2022 +0100
Remove COMPILER_PLUGINS_CXX from
distro-configs/Jenkins/linux_clang_dbgutil_64
It had originally been added with e754d0931ca75403647cc16100edd98e7e5ceadb
"Remove CXXFLAGS_CXX11 from Clang plugin compilation", so "if
COMPILER_PLUGINS_CXX is not set, simply default it to g++ instead of trying
to
construct an acceptable CLANGCXX value from CXX (which would be Clang).
(The
problem with using Clang without CXXFLAGS_CXX11 is that Clang, unlike GCC,
typically defaults to C++03, but building compilerplugins requires C++11 at
least. That would cause e.g. the Gerrit/Jenkins linux_clang_dbgutil_64
builds
to fail---but which also needs COMPILER_PLUGINS_CXX to be explicitly set to
'g++
-std=c++11' as GCC on those machines is still 4.8.5 defaulting to C++03."
But
that should no longer be an issue with contemporary Clang, which defaults
to >=
C++11 for quite a while now.
On the other hand, when trying to update the Clang used by
<https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/> from 5.0.2 to
12.0.1, and adding
> export COMPILER_PLUGINS_CXX="ccache
$LODE_HOME"/opt_private/gcc-7.3.0/bin/g++
to
<https://git.libreoffice.org/lode/+/refs/heads/master/bin/linux_clang_dbgutil_64.env>
... etc. - the rest is truncated