summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-25 15:05:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-25 20:05:10 +0200
commit28993c0a8d8628c650b661767fd8ab2228c507d9 (patch)
tree74777bc270aae8bf1e7c5dc866a0817aea8c71e1
parent2b71e0683cf8a34aaddce3558b941ba62b1b4ec5 (diff)
use officecfg for drawing options
Change-Id: Idba40d9816f29c0e4bc4a468b8c0a2cbb74d09d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119481 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--cui/source/dialogs/screenshotannotationdlg.cxx7
-rw-r--r--cui/source/options/optgdlg.cxx9
-rw-r--r--cui/source/options/optgdlg.hxx2
-rw-r--r--cui/source/tabpages/grfpage.cxx7
-rw-r--r--cui/source/tabpages/page.cxx17
-rw-r--r--drawinglayer/inc/processor3d/defaultprocessor3d.hxx7
-rw-r--r--drawinglayer/source/primitive2d/controlprimitive2d.cxx3
-rw-r--r--drawinglayer/source/primitive2d/sceneprimitive2d.cxx5
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx15
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx10
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.hxx7
-rw-r--r--drawinglayer/source/processor3d/defaultprocessor3d.cxx1
-rw-r--r--drawinglayer/source/processor3d/zbufferprocessor3d.cxx3
-rw-r--r--include/svtools/optionsdrawinglayer.hxx182
-rw-r--r--include/svx/sdr/overlay/overlaymanager.hxx7
-rw-r--r--include/svx/svdpntv.hxx9
-rw-r--r--sc/source/ui/view/drawvie3.cxx5
-rw-r--r--sc/source/ui/view/gridwin.cxx4
-rw-r--r--sd/source/ui/view/sdview.cxx5
-rw-r--r--sfx2/source/control/thumbnailview.cxx3
-rw-r--r--svtools/source/config/optionsdrawinglayer.cxx941
-rw-r--r--svx/source/dialog/weldeditview.cxx3
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx5
-rw-r--r--svx/source/sdr/overlay/overlaymanager.cxx6
-rw-r--r--svx/source/sdr/overlay/overlaymanagerbuffered.cxx3
-rw-r--r--svx/source/sdr/overlay/overlaypolypolygon.cxx6
-rw-r--r--svx/source/sdr/overlay/overlayrollingrectangle.cxx6
-rw-r--r--svx/source/sdr/overlay/overlayselection.cxx7
-rw-r--r--svx/source/svdraw/sdrpagewindow.cxx4
-rw-r--r--svx/source/svdraw/sdrpaintwindow.cxx9
-rw-r--r--svx/source/svdraw/svddrgmt.cxx22
-rw-r--r--svx/source/svdraw/svddrgv.cxx5
-rw-r--r--svx/source/svdraw/svdedxv.cxx12
-rw-r--r--svx/source/svdraw/svdhdl.cxx9
-rw-r--r--svx/source/svdraw/svdmrkv.cxx4
-rw-r--r--svx/source/svdraw/svdpntv.cxx5
-rw-r--r--svx/source/table/tablehandles.cxx6
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx8
-rw-r--r--sw/source/core/crsr/viscrs.cxx8
-rw-r--r--sw/source/core/doc/notxtfrm.cxx8
-rw-r--r--sw/source/core/draw/dview.cxx9
-rw-r--r--sw/source/core/inc/dview.hxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx5
-rw-r--r--sw/source/uibase/docvw/OverlayRanges.cxx4
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.cxx5
45 files changed, 283 insertions, 1127 deletions
diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx
index 4a93d7b16aad..bdae7f003b8d 100644
--- a/cui/source/dialogs/screenshotannotationdlg.cxx
+++ b/cui/source/dialogs/screenshotannotationdlg.cxx
@@ -440,10 +440,9 @@ void ScreenshotAnnotationDlg_Impl::RepaintToBuffer(
bUseDimmed ? maDimmedDialogBitmap : maParentDialogBitmap);
// get various options
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
- const bool bIsAntiAliasing(aSvtOptionsDrawinglayer.IsAntiAliasing());
+ const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
+ const bool bIsAntiAliasing(SvtOptionsDrawinglayer::IsAntiAliasing());
const AntialiasingFlags nOldAA(mxVirtualBufferDevice->GetAntialiasing());
if (bIsAntiAliasing)
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index f1f46e144701..30ca6b79a068 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -522,7 +522,6 @@ OfaViewTabPage::OfaViewTabPage(weld::Container* pPage, weld::DialogController* p
, nStyleLB_InitialSelection(0)
, pAppearanceCfg(new SvtTabAppearanceCfg)
, pCanvasSettings(new CanvasSettings)
- , mpDrawinglayerOpt(new SvtOptionsDrawinglayer)
, m_xIconSizeLB(m_xBuilder->weld_combo_box("iconsize"))
, m_xSidebarIconSizeLB(m_xBuilder->weld_combo_box("sidebariconsize"))
, m_xNotebookbarIconSizeLB(m_xBuilder->weld_combo_box("notebookbariconsize"))
@@ -808,9 +807,9 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* )
// #i95644# if disabled, do not use value, see in ::Reset()
if (m_xUseAntiAliase->get_sensitive())
{
- if (m_xUseAntiAliase->get_active() != mpDrawinglayerOpt->IsAntiAliasing())
+ if (m_xUseAntiAliase->get_active() != SvtOptionsDrawinglayer::IsAntiAliasing())
{
- mpDrawinglayerOpt->SetAntiAliasing(m_xUseAntiAliase->get_active());
+ SvtOptionsDrawinglayer::SetAntiAliasing(m_xUseAntiAliase->get_active(), /*bTemporary*/false);
bModified = true;
bRepaintWindows = true;
}
@@ -940,9 +939,9 @@ void OfaViewTabPage::Reset( const SfxItemSet* )
m_xUseHardwareAccell->save_state();
{ // #i95644# AntiAliasing
- if(mpDrawinglayerOpt->IsAAPossibleOnThisSystem())
+ if(SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem())
{
- m_xUseAntiAliase->set_active(mpDrawinglayerOpt->IsAntiAliasing());
+ m_xUseAntiAliase->set_active(SvtOptionsDrawinglayer::IsAntiAliasing());
}
else
{
diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx
index 3d4c342a73a6..ffdfdb423195 100644
--- a/cui/source/options/optgdlg.hxx
+++ b/cui/source/options/optgdlg.hxx
@@ -22,7 +22,6 @@
#include <svx/langbox.hxx>
class CanvasSettings;
-class SvtOptionsDrawinglayer;
namespace vcl {
class IconThemeInfo;
@@ -83,7 +82,6 @@ private:
std::unique_ptr<SvtTabAppearanceCfg> pAppearanceCfg;
std::unique_ptr<CanvasSettings> pCanvasSettings;
- std::unique_ptr<SvtOptionsDrawinglayer> mpDrawinglayerOpt;
std::vector<vcl::IconThemeInfo> mInstalledIconThemes;
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index beb8bc207ddd..644859790e32 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -726,10 +726,9 @@ void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
// PolygonMarkerPrimitive2D, may be changed to that primitive later.
// Use this to guarantee good visibility - that was the purpose of
// the former used XOR paint.
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
- const Color aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
- const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
+ const Color aColA(SvtOptionsDrawinglayer::GetStripeColorA().getBColor());
+ const Color aColB(SvtOptionsDrawinglayer::GetStripeColorB().getBColor());
+ const double fStripeLength(SvtOptionsDrawinglayer::GetStripeLength());
const basegfx::B2DVector aDashVector(rRenderContext.GetInverseViewTransformation() * basegfx::B2DVector(fStripeLength, 0.0));
const double fLogicDashLength(aDashVector.getX());
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 83014c794eb3..44f29780904c 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -272,21 +272,18 @@ SvxPageDescPage::SvxPageDescPage(weld::Container* pPage, weld::DialogController*
nLastTopMargin = m_xTopMarginEdit->convert_value_from(m_xTopMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
nLastBottomMargin = m_xBottomMarginEdit->convert_value_from(m_xBottomMarginEdit->normalize(aPrintOffset.Y() + aPrintSize.Height()), FieldUnit::TWIP);
- // #i4219# get DrawingLayer options
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
-
// #i4219# take Maximum now from configuration (1/100th cm)
// was: 11900 -> 119 cm ;new value 3 meters -> 300 cm -> 30000
- m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM);
- m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM);
+ m_xPaperWidthEdit->set_max(m_xPaperWidthEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperWidth()), FieldUnit::CM);
+ m_xPaperHeightEdit->set_max(m_xPaperHeightEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperHeight()), FieldUnit::CM);
// #i4219# also for margins (1/100th cm). Was: 9999, keeping.
- m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperLeftMargin()), FieldUnit::MM);
- m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperRightMargin()), FieldUnit::MM);
- m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperTopMargin()), FieldUnit::MM);
- m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperBottomMargin()), FieldUnit::MM);
+ m_xLeftMarginEdit->set_max(m_xLeftMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin()), FieldUnit::MM);
+ m_xRightMarginEdit->set_max(m_xRightMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperRightMargin()), FieldUnit::MM);
+ m_xTopMarginEdit->set_max(m_xTopMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperTopMargin()), FieldUnit::MM);
+ m_xBottomMarginEdit->set_max(m_xBottomMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin()), FieldUnit::MM);
m_xGutterMarginEdit->set_max(
- m_xGutterMarginEdit->normalize(aDrawinglayerOpt.GetMaximumPaperLeftMargin()),
+ m_xGutterMarginEdit->normalize(SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin()),
FieldUnit::MM);
// Get the i18n framework numberings and add them to the listbox.
diff --git a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx
index 4db2bde555c8..aace2ef87742 100644
--- a/drawinglayer/inc/processor3d/defaultprocessor3d.hxx
+++ b/drawinglayer/inc/processor3d/defaultprocessor3d.hxx
@@ -22,7 +22,6 @@
#include <drawinglayer/processor3d/baseprocessor3d.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/color/bcolormodifier.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
// predefines
@@ -83,9 +82,6 @@ namespace drawinglayer::processor3d
/// the current active transparence texture
std::shared_ptr< texture::GeoTexSvx > mpTransparenceGeoTexSvx;
- /// SvtOptionsDrawinglayer incarnation to react on diverse settings
- const SvtOptionsDrawinglayer maDrawinglayerOpt;
-
/// counter for entered transparence textures
sal_uInt32 mnTransparenceCounter;
@@ -133,9 +129,6 @@ namespace drawinglayer::processor3d
bool getModulate() const { return mbModulate; }
bool getFilter() const { return mbFilter; }
bool getSimpleTextureActive() const { return mbSimpleTextureActive; }
-
- /// access to Drawinglayer configuration options
- const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
};
} // end of namespace drawinglayer::processor3d
diff --git a/drawinglayer/source/primitive2d/controlprimitive2d.cxx b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
index 26e42a17cdd1..5421a696742b 100644
--- a/drawinglayer/source/primitive2d/controlprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/controlprimitive2d.cxx
@@ -96,8 +96,7 @@ namespace drawinglayer::primitive2d
basegfx::B2DVector aDiscreteSize(rViewInformation.getObjectToViewTransformation() * aScale);
// limit to a maximum square size, e.g. 300x150 pixels (45000)
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
- const double fDiscreteMax(aDrawinglayerOpt.GetQuadraticFormControlRenderLimit());
+ const double fDiscreteMax(SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit());
const double fDiscreteQuadratic(aDiscreteSize.getX() * aDiscreteSize.getY());
const bool bScaleUsed(fDiscreteQuadratic > fDiscreteMax);
double fFactor(1.0);
diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
index 27f2f5a3638a..9c8cc2b39c71 100644
--- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx
@@ -243,8 +243,7 @@ namespace drawinglayer::primitive2d
double fViewSizeX(aVisibleDiscreteRange.getWidth());
double fViewSizeY(aVisibleDiscreteRange.getHeight());
const double fViewVisibleArea(fViewSizeX * fViewSizeY);
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
- const double fMaximumVisibleArea(aDrawinglayerOpt.GetQuadratic3DRenderLimit());
+ const double fMaximumVisibleArea(SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit());
double fReduceFactor(1.0);
if(fViewVisibleArea > fMaximumVisibleArea)
@@ -282,7 +281,7 @@ namespace drawinglayer::primitive2d
// determine the oversample value
static const sal_uInt16 nDefaultOversampleValue(3);
- const sal_uInt16 nOversampleValue(aDrawinglayerOpt.IsAntiAliasing() ? nDefaultOversampleValue : 0);
+ const sal_uInt16 nOversampleValue(SvtOptionsDrawinglayer::IsAntiAliasing() ? nDefaultOversampleValue : 0);
geometry::ViewInformation3D aViewInformation3D(getViewInformation3D());
{
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 9bdbf95a015b..a0990edf7645 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/awt/XWindow2.hpp>
#include <com/sun/star/awt/XControl.hpp>
+#include <svtools/optionsdrawinglayer.hxx>
#include <vcl/gradient.hxx>
using namespace com::sun::star;
@@ -91,7 +92,7 @@ VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rVie
mpOutputDevice->SetMapMode();
// react on AntiAliasing settings
- if (getOptionsDrawinglayer().IsAntiAliasing())
+ if (SvtOptionsDrawinglayer::IsAntiAliasing())
{
mpOutputDevice->SetAntialiasing(m_pImpl->m_nOrigAntiAliasing | AntialiasingFlags::Enable);
}
@@ -455,7 +456,7 @@ void VclPixelProcessor2D::processTextSimplePortionPrimitive2D(
const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
- if (getOptionsDrawinglayer().IsRenderSimpleTextDirect())
+ if (SvtOptionsDrawinglayer::IsRenderSimpleTextDirect())
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
}
@@ -475,7 +476,7 @@ void VclPixelProcessor2D::processTextDecoratedPortionPrimitive2D(
const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
- if (getOptionsDrawinglayer().IsRenderDecoratedTextDirect())
+ if (SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect())
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
}
@@ -563,7 +564,7 @@ void VclPixelProcessor2D::processPolyPolygonColorPrimitive2D(
// when AA is on and this filled polygons are the result of stroked line geometry,
// draw the geometry once extra as lines to avoid AA 'gaps' between partial polygons
// Caution: This is needed in both cases (!)
- if (!(mnPolygonStrokePrimitive2D && getOptionsDrawinglayer().IsAntiAliasing()
+ if (!(mnPolygonStrokePrimitive2D && SvtOptionsDrawinglayer::IsAntiAliasing()
&& (mpOutputDevice->GetAntialiasing() & AntialiasingFlags::Enable)))
return;
@@ -784,7 +785,7 @@ void VclPixelProcessor2D::processPolygonStrokePrimitive2D(
void VclPixelProcessor2D::processFillHatchPrimitive2D(
const primitive2d::FillHatchPrimitive2D& rFillHatchPrimitive)
{
- if (getOptionsDrawinglayer().IsAntiAliasing())
+ if (SvtOptionsDrawinglayer::IsAntiAliasing())
{
// if AA is used (or ignore smoothing is on), there is no need to smooth
// hatch painting, use decomposition
@@ -951,8 +952,8 @@ void VclPixelProcessor2D::processInvertPrimitive2D(const primitive2d::BasePrimit
void VclPixelProcessor2D::processMetaFilePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate)
{
// #i98289#
- const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing()
- && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
+ const bool bForceLineSnap(SvtOptionsDrawinglayer::IsAntiAliasing()
+ && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete());
const AntialiasingFlags nOldAntiAliase(mpOutputDevice->GetAntialiasing());
if (bForceLineSnap)
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 5bd7e0194b66..bd6af1b27221 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -23,6 +23,7 @@
#include "vclhelperbufferdevice.hxx"
#include <cmath>
#include <comphelper/string.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <tools/debug.hxx>
#include <vcl/graph.hxx>
#include <vcl/outdev.hxx>
@@ -346,8 +347,8 @@ void VclProcessor2D::RenderPolygonHairlinePrimitive2D(
basegfx::B2DPolygon aLocalPolygon(rPolygonCandidate.getB2DPolygon());
aLocalPolygon.transform(maCurrentTransformation);
- if (bPixelBased && getOptionsDrawinglayer().IsAntiAliasing()
- && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete())
+ if (bPixelBased && SvtOptionsDrawinglayer::IsAntiAliasing()
+ && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete())
{
// #i98289#
// when a Hairline is painted and AntiAliasing is on the option SnapHorVerLinesToDiscrete
@@ -765,7 +766,7 @@ void VclProcessor2D::RenderMaskPrimitive2DPixel(const primitive2d::MaskPrimitive
aMask.transform(maCurrentTransformation);
// Unless smooth edges are needed, simply use clipping.
- if (basegfx::utils::isRectangle(aMask) || !getOptionsDrawinglayer().IsAntiAliasing())
+ if (basegfx::utils::isRectangle(aMask) || !SvtOptionsDrawinglayer::IsAntiAliasing())
{
mpOutputDevice->Push(PushFlags::CLIPREGION);
mpOutputDevice->IntersectClipRegion(vcl::Region(aMask));
@@ -1042,7 +1043,7 @@ void VclProcessor2D::RenderPolygonStrokePrimitive2D(
if (nCount)
{
- const bool bAntiAliased(getOptionsDrawinglayer().IsAntiAliasing());
+ const bool bAntiAliased(SvtOptionsDrawinglayer::IsAntiAliasing());
aHairlinePolyPolygon.transform(maCurrentTransformation);
if (bAntiAliased)
@@ -1475,7 +1476,6 @@ VclProcessor2D::VclProcessor2D(const geometry::ViewInformation2D& rViewInformati
, mpOutputDevice(&rOutDev)
, maBColorModifierStack(rInitStack)
, maCurrentTransformation()
- , maDrawinglayerOpt()
, mnPolygonStrokePrimitive2D(0)
, mpObjectInfoPrimitive2D(nullptr)
{
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.hxx b/drawinglayer/source/processor2d/vclprocessor2d.hxx
index dbca9ed4ba25..7e251aa0ca13 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.hxx
@@ -22,7 +22,6 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/color/bcolormodifier.hxx>
-#include <svtools/optionsdrawinglayer.hxx>
#include <vcl/vclptr.hxx>
class OutputDevice;
@@ -73,9 +72,6 @@ protected:
// ViewInformation2D cannot directly be used, but needs to be kept up to date
basegfx::B2DHomMatrix maCurrentTransformation;
- // SvtOptionsDrawinglayer incarnation to react on diverse settings
- const SvtOptionsDrawinglayer maDrawinglayerOpt;
-
// stack value (increment and decrement) to count how deep we are in
// PolygonStrokePrimitive2D's decompositions (normally only one)
sal_uInt32 mnPolygonStrokePrimitive2D;
@@ -124,9 +120,6 @@ public:
const basegfx::BColorModifierStack& rInitStack = basegfx::BColorModifierStack());
virtual ~VclProcessor2D() override;
- // access to Drawinglayer configuration options
- const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
-
// access to currently used ObjectInfoPrimitive2D
const primitive2d::ObjectInfoPrimitive2D* getObjectInfoPrimitive2D() const
{
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 51dfefb6ac5d..7e8191d6dccf 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -581,7 +581,6 @@ namespace drawinglayer::processor3d
maBColorModifierStack(),
mpGeoTexSvx(),
mpTransparenceGeoTexSvx(),
- maDrawinglayerOpt(),
mnTransparenceCounter(0),
mbModulate(false),
mbFilter(false),
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index 56cfc3c45c18..b2a6422b556e 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -27,6 +27,7 @@
#include <basegfx/polygon/b3dpolygontools.hxx>
#include <basegfx/polygon/b3dpolypolygontools.hxx>
#include <drawinglayer/attribute/sdrlightingattribute3d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
using namespace com::sun::star;
@@ -440,7 +441,7 @@ namespace drawinglayer::processor3d
if(mnAntiAlialize > 1)
{
- const bool bForceLineSnap(getOptionsDrawinglayer().IsAntiAliasing() && getOptionsDrawinglayer().IsSnapHorVerLinesToDiscrete());
+ const bool bForceLineSnap(SvtOptionsDrawinglayer::IsAntiAliasing() && SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete());
if(bForceLineSnap)
{
diff --git a/include/svtools/optionsdrawinglayer.hxx b/include/svtools/optionsdrawinglayer.hxx
index 139f8d56834d..5d6316aa30e6 100644
--- a/include/svtools/optionsdrawinglayer.hxx
+++ b/include/svtools/optionsdrawinglayer.hxx
@@ -22,114 +22,82 @@
#include <svtools/svtdllapi.h>
#include <sal/types.h>
#include <tools/color.hxx>
-#include <memory>
-namespace osl { class Mutex; }
-
-/*-************************************************************************************************************
- @short forward declaration to our private date container implementation
- @descr We use these class as internal member to support small memory requirements.
- You can create the container if it is necessary. The class which use these mechanism
- is faster and smaller then a complete implementation!
-*//*-*************************************************************************************************************/
-
-class SvtOptionsDrawinglayer_Impl;
-
-/*-************************************************************************************************************
- @short collect information about startup features
- @devstatus ready to use
-*//*-*************************************************************************************************************/
-
-class SVT_DLLPUBLIC SvtOptionsDrawinglayer
+namespace SvtOptionsDrawinglayer
{
- public:
-
- SvtOptionsDrawinglayer();
- ~SvtOptionsDrawinglayer();
-
- /*-****************************************************************************************************
- @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
- @descr These options describe internal states to enable/disable features of installed office.
-
- IsOverlayBuffer()
- SetOverlayBuffer() => Activate this field for letting Overlay use a buffer
-
- IsPaintBuffer()
- SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer
-
- GetStripeColorA()
- SetStripeColorA() => Set first of two colors which overlay uses to draw stripes
-
- GetStripeColorB()
- SetStripeColorB() => Set second of two colors which overlay uses to draw stripes
-
- GetStripeLength()
- SetStripeLength() => Set length of a single stripe in pixels
-
- @seealso configuration package "org.openoffice.Office.Common/Drawinglayer"
- *//*-*****************************************************************************************************/
-
- bool IsOverlayBuffer() const;
- bool IsPaintBuffer() const;
- Color GetStripeColorA() const;
- Color GetStripeColorB() const;
- sal_uInt16 GetStripeLength() const;
-
- // #i73602#
- bool IsOverlayBuffer_Calc() const;
- bool IsOverlayBuffer_Writer() const;
- bool IsOverlayBuffer_DrawImpress() const;
-
- // #i74769#, #i75172#
- bool IsPaintBuffer_Calc() const;
- bool IsPaintBuffer_Writer() const;
- bool IsPaintBuffer_DrawImpress() const;
-
- // #i4219#
- sal_uInt32 GetMaximumPaperWidth() const;
- sal_uInt32 GetMaximumPaperHeight() const;
- sal_uInt32 GetMaximumPaperLeftMargin() const;
- sal_uInt32 GetMaximumPaperRightMargin() const;
- sal_uInt32 GetMaximumPaperTopMargin() const;
- sal_uInt32 GetMaximumPaperBottomMargin() const;
-
- // #i95644# helper to check if AA is allowed on this system. Currently, for WIN it's disabled
- // and OutDevSupportType::TransparentRect is checked (this hits XRenderExtension, e.g.
- // currently for SunRay as long as not supported there)
- bool IsAAPossibleOnThisSystem() const;
-
- // primitives
- bool IsAntiAliasing() const;
- bool IsSnapHorVerLinesToDiscrete() const;
- bool IsSolidDragCreate() const;
- bool IsRenderDecoratedTextDirect() const;
- bool IsRenderSimpleTextDirect() const;
- sal_uInt32 GetQuadratic3DRenderLimit() const;
- sal_uInt32 GetQuadraticFormControlRenderLimit() const;
-
- void SetAntiAliasing( bool bState );
-
- // #i97672# selection settings
- bool IsTransparentSelection() const;
- sal_uInt16 GetTransparentSelectionPercent() const;
- sal_uInt16 GetSelectionMaximumLuminancePercent() const;
-
- // get system highlight color, limited to the maximum allowed luminance
- // (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer,
- // combined with Application::GetSettings().GetStyleSettings().GetHighlightColor())
- Color getHilightColor() const;
-
- private:
-
- /*-****************************************************************************************************
- @short return a reference to a static mutex
- @descr These class use his own static mutex to be threadsafe.
- We create a static mutex only for one ime and use at different times.
- @return A reference to a static mutex member.
- *//*-*****************************************************************************************************/
- SVT_DLLPRIVATE static ::osl::Mutex& GetOwnStaticMutex();
-
- std::shared_ptr<SvtOptionsDrawinglayer_Impl> m_pImpl;
-};
+
+/*-****************************************************************************************************
+ @short interface methods to get and set value of config key "org.openoffice.Office.Common/Drawinglayer/..."
+ @descr These options describe internal states to enable/disable features of installed office.
+
+ IsOverlayBuffer()
+ SetOverlayBuffer() => Activate this field for letting Overlay use a buffer
+
+ IsPaintBuffer()
+ SetPaintBuffer() => Activate this field for letting Paint use a prerender buffer
+
+ GetStripeColorA()
+ SetStripeColorA() => Set first of two colors which overlay uses to draw stripes
+
+ GetStripeColorB()
+ SetStripeColorB() => Set second of two colors which overlay uses to draw stripes
+
+ GetStripeLength()
+ SetStripeLength() => Set length of a single stripe in pixels
+
+ @seealso configuration package "org.openoffice.Office.Common/Drawinglayer"
+*//*-*****************************************************************************************************/
+
+SVT_DLLPUBLIC bool IsOverlayBuffer();
+SVT_DLLPUBLIC bool IsPaintBuffer();
+SVT_DLLPUBLIC Color GetStripeColorA();
+SVT_DLLPUBLIC Color GetStripeColorB();
+SVT_DLLPUBLIC sal_uInt16 GetStripeLength();
+
+// #i73602#
+SVT_DLLPUBLIC bool IsOverlayBuffer_Calc();
+SVT_DLLPUBLIC bool IsOverlayBuffer_Writer();
+SVT_DLLPUBLIC bool IsOverlayBuffer_DrawImpress();
+
+// #i74769#, #i75172#
+SVT_DLLPUBLIC bool IsPaintBuffer_Calc();
+SVT_DLLPUBLIC bool IsPaintBuffer_Writer();
+SVT_DLLPUBLIC bool IsPaintBuffer_DrawImpress();
+
+// #i4219#
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperWidth();
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperHeight();
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperLeftMargin();
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperRightMargin();
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperTopMargin();
+SVT_DLLPUBLIC sal_uInt32 GetMaximumPaperBottomMargin();
+
+// #i95644# helper to check if AA is allowed on this system. Currently, for WIN it's disabled
+// and OutDevSupportType::TransparentRect is checked (this hits XRenderExtension, e.g.
+// currently for SunRay as long as not supported there)
+SVT_DLLPUBLIC bool IsAAPossibleOnThisSystem();
+
+// primitives
+SVT_DLLPUBLIC bool IsAntiAliasing();
+SVT_DLLPUBLIC bool IsSnapHorVerLinesToDiscrete();
+SVT_DLLPUBLIC bool IsSolidDragCreate();
+SVT_DLLPUBLIC bool IsRenderDecoratedTextDirect();
+SVT_DLLPUBLIC bool IsRenderSimpleTextDirect();
+SVT_DLLPUBLIC sal_uInt32 GetQuadratic3DRenderLimit();
+SVT_DLLPUBLIC sal_uInt32 GetQuadraticFormControlRenderLimit();
+
+SVT_DLLPUBLIC void SetAntiAliasing( bool bOn, bool bTemporary );
+
+// #i97672# selection settings
+SVT_DLLPUBLIC bool IsTransparentSelection();
+SVT_DLLPUBLIC sal_uInt16 GetTransparentSelectionPercent();
+SVT_DLLPUBLIC sal_uInt16 GetSelectionMaximumLuminancePercent();
+
+// get system highlight color, limited to the maximum allowed luminance
+// (defined in GetSelectionMaximumLuminancePercent() in SvtOptionsDrawinglayer,
+// combined with Application::GetSettings().GetStyleSettings().GetHighlightColor())
+SVT_DLLPUBLIC Color getHilightColor();
+
+} // namespace SvtOptionsDrawinglayer
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/sdr/overlay/overlaymanager.hxx b/include/svx/sdr/overlay/overlaymanager.hxx
index 11ed2c9d0b97..696cf5c992c9 100644
--- a/include/svx/sdr/overlay/overlaymanager.hxx
+++ b/include/svx/sdr/overlay/overlaymanager.hxx
@@ -26,7 +26,6 @@
#include <tools/color.hxx>
#include <tools/gen.hxx>
#include <svx/svxdllapi.h>
-#include <svtools/optionsdrawinglayer.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <salhelper/simplereferenceobject.hxx>
@@ -66,9 +65,6 @@ namespace sdr::overlay
Color maStripeColorB; // defaults to COL_WHITE
sal_uInt32 mnStripeLengthPixel; // defaults to 4L
- // hold an incarnation of Drawinglayer configuration options
- SvtOptionsDrawinglayer maDrawinglayerOpt;
-
// hold buffered the logic length of discrete vector (1.0, 0.0) and the
// view transformation belonging to it. Update happens in getDiscreteOne()
basegfx::B2DHomMatrix maViewTransformation;
@@ -124,9 +120,6 @@ namespace sdr::overlay
sal_uInt32 getStripeLengthPixel() const { return mnStripeLengthPixel; }
void setStripeLengthPixel(sal_uInt32 nNew);
- // access to maDrawinglayerOpt
- const SvtOptionsDrawinglayer& getDrawinglayerOpt() const { return maDrawinglayerOpt; }
-
void InsertEvent(sdr::animation::Event& rNew) { Scheduler::InsertEvent(rNew); }
};
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 0e06b2c681db..83e080fbdc3a 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -27,7 +27,6 @@
#include <svtools/colorcfg.hxx>
#include <svl/itemset.hxx>
#include <svx/svxdllapi.h>
-#include <svtools/optionsdrawinglayer.hxx>
#include <unotools/options.hxx>
#include <vcl/event.hxx>
#include <vcl/idle.hxx>
@@ -150,9 +149,6 @@ protected:
sal_uInt16 mnHitTolLog;
sal_uInt16 mnMinMovLog;
- // Hold an incarnation of Drawinglayer configuration options
- SvtOptionsDrawinglayer maDrawinglayerOpt;
-
bool mbPageVisible : 1;
bool mbPageShadowVisible : 1;
bool mbPageBorderVisible : 1;
@@ -216,7 +212,7 @@ protected:
// Interface to SdrPaintWindow
void DeletePaintWindow(SdrPaintWindow& rOld);
void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, ConfigurationHints ) override;
- void InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager) const;
+ static void InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager);
public:
sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); }
@@ -503,9 +499,6 @@ public:
// #i38135#
// Sets the timer for Object animations and restarts.
void SetAnimationTimer(sal_uInt32 nTime);
-
- // Access to Drawinglayer configuration options
- const SvtOptionsDrawinglayer& getOptionsDrawinglayer() const { return maDrawinglayerOpt; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index e120811a4d23..88c74b442bfe 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -25,6 +25,7 @@
#include <svx/svdoole2.hxx>
#include <svx/ImageMapInfo.hxx>
#include <sfx2/viewfrm.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <strings.hrc>
#include <scresid.hxx>
@@ -49,10 +50,10 @@ ScDrawView::ScDrawView(
bInConstruct( true )
{
// #i73602# Use default from the configuration
- SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_Calc());
+ SetBufferedOverlayAllowed(SvtOptionsDrawinglayer::IsOverlayBuffer_Calc());
// #i74769#, #i75172# Use default from the configuration
- SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_Calc());
+ SetBufferedOutputAllowed(SvtOptionsDrawinglayer::IsPaintBuffer_Calc());
Construct();
}
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 87ac3d9b9ebe..f944f72faea7 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -51,6 +51,7 @@
#include <editeng/outliner.hxx>
#include <svx/svdocapt.hxx>
#include <svx/svdpagv.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <com/sun/star/sheet/DataPilotFieldFilter.hpp>
#include <com/sun/star/sheet/DataPilotFieldOrientation.hpp>
@@ -6349,8 +6350,7 @@ void ScGridWindow::UpdateSelectionOverlay()
}
// get the system's highlight color
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+ const Color aHighlight(SvtOptionsDrawinglayer::getHilightColor());
std::unique_ptr<sdr::overlay::OverlayObject> pOverlay(new sdr::overlay::OverlaySelection(
sdr::overlay::OverlayType::Transparent,
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index c70107905b02..d2b9816f40e9 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -80,6 +80,7 @@
#include <sfx2/lokhelper.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <DrawController.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <memory>
#include <numeric>
@@ -108,10 +109,10 @@ View::View(
mpClipboard (new ViewClipboard (*this))
{
// #i73602# Use default from the configuration
- SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_DrawImpress());
+ SetBufferedOverlayAllowed(SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress());
// #i74769#, #i75172# Use default from the configuration
- SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_DrawImpress());
+ SetBufferedOutputAllowed(SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress());
EnableExtendedKeyInputDispatcher(false);
EnableExtendedMouseEventDispatcher(false);
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index c66ccf2655a5..a6b395a0b666 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -258,8 +258,7 @@ void ThumbnailView::ImplInit()
maSelectHighlightColor = rSettings.GetActiveColor();
maSelectHighlightTextColor = rSettings.GetActiveTextColor();
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- mfHighlightTransparence = aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01;
+ mfHighlightTransparence = SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01;
mpStartSelRange = mFilteredItemList.end();
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index 2f78f49e0104..c615a2f6b6a0 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -18,943 +18,187 @@
*/
#include <svtools/optionsdrawinglayer.hxx>
-#include <unotools/configmgr.hxx>
-#include <unotools/configitem.hxx>
#include <tools/debug.hxx>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
#include <vcl/svapp.hxx>
#include <vcl/outdev.hxx>
#include <vcl/settings.hxx>
-#include <rtl/instance.hxx>
-
-// namespaces
-
-using namespace ::utl ;
-using namespace ::osl ;
-using namespace ::com::sun::star::uno ;
-
-#define ROOTNODE_START "Office.Common/Drawinglayer"
-#define DEFAULT_OVERLAYBUFFER true
-#define DEFAULT_PAINTBUFFER true
-#define DEFAULT_STRIPE_COLOR_A Color(0)
-#define DEFAULT_STRIPE_COLOR_B Color(16581375)
-#define DEFAULT_STRIPE_LENGTH 4
-
-// #i73602#
-// #i74769#, #i75172# : Change default for Calc and Writer to True
-#define DEFAULT_OVERLAYBUFFER_CALC true
-#define DEFAULT_OVERLAYBUFFER_WRITER true
-#define DEFAULT_OVERLAYBUFFER_DRAWIMPRESS true
-
-// #i74769#, #i75172#
-#define DEFAULT_PAINTBUFFER_CALC true
-#define DEFAULT_PAINTBUFFER_WRITER true
-#define DEFAULT_PAINTBUFFER_DRAWIMPRESS true
-
-// #i4219#
-#define DEFAULT_MAXIMUMPAPERWIDTH 600
-#define DEFAULT_MAXIMUMPAPERHEIGHT 600
-#define DEFAULT_MAXIMUMPAPERLEFTMARGIN 9999
-#define DEFAULT_MAXIMUMPAPERRIGHTMARGIN 9999
-#define DEFAULT_MAXIMUMPAPERTOPMARGIN 9999
-#define DEFAULT_MAXIMUMPAPERBOTTOMMARGIN 9999
-
-// primitives
-#define DEFAULT_ANTIALIASING true
-#define DEFAULT_SNAPHORVERLINESTODISCRETE true
-#define DEFAULT_SOLIDDRAGCREATE true
-#define DEFAULT_RENDERDECORATEDTEXTDIRECT true
-#define DEFAULT_RENDERSIMPLETEXTDIRECT true
-#define DEFAULT_QUADRATIC3DRENDERLIMIT 1000000
-#define DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT 45000
-
-// #i97672# selection settings
-#define DEFAULT_TRANSPARENTSELECTION true
-#define DEFAULT_TRANSPARENTSELECTIONPERCENT 75
-#define DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT 70
-
-constexpr OUStringLiteral PROPERTYNAME_OVERLAYBUFFER = u"OverlayBuffer";
-constexpr OUStringLiteral PROPERTYNAME_PAINTBUFFER = u"PaintBuffer";
-constexpr OUStringLiteral PROPERTYNAME_STRIPE_COLOR_A = u"StripeColorA";
-constexpr OUStringLiteral PROPERTYNAME_STRIPE_COLOR_B = u"StripeColorB";
-constexpr OUStringLiteral PROPERTYNAME_STRIPE_LENGTH = u"StripeLength";
+#include <officecfg/Office/Common.hxx>
+#include <mutex>
// #i73602#
-constexpr OUStringLiteral PROPERTYNAME_OVERLAYBUFFER_CALC = u"OverlayBuffer_Calc";
-constexpr OUStringLiteral PROPERTYNAME_OVERLAYBUFFER_WRITER = u"OverlayBuffer_Writer";
-constexpr OUStringLiteral PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS = u"OverlayBuffer_DrawImpress";
-
-// #i74769#, #i75172#
-constexpr OUStringLiteral PROPERTYNAME_PAINTBUFFER_CALC = u"PaintBuffer_Calc";
-constexpr OUStringLiteral PROPERTYNAME_PAINTBUFFER_WRITER = u"PaintBuffer_Writer";
-constexpr OUStringLiteral PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS = u"PaintBuffer_DrawImpress";
-
-// #i4219#
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERWIDTH = u"MaximumPaperWidth";
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERHEIGHT = u"MaximumPaperHeight";
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN = u"MaximumPaperLeftMargin";
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN = u"MaximumPaperRightMargin";
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERTOPMARGIN = u"MaximumPaperTopMargin";
-constexpr OUStringLiteral PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN = u"MaximumPaperBottomMargin";
-
-// primitives
-constexpr OUStringLiteral PROPERTYNAME_ANTIALIASING = u"AntiAliasing";
-constexpr OUStringLiteral PROPERTYNAME_SNAPHORVERLINESTODISCRETE = u"SnapHorVerLinesToDiscrete";
-constexpr OUStringLiteral PROPERTYNAME_SOLIDDRAGCREATE = u"SolidDragCreate";
-constexpr OUStringLiteral PROPERTYNAME_RENDERDECORATEDTEXTDIRECT = u"RenderDecoratedTextDirect";
-constexpr OUStringLiteral PROPERTYNAME_RENDERSIMPLETEXTDIRECT = u"RenderSimpleTextDirect";
-constexpr OUStringLiteral PROPERTYNAME_QUADRATIC3DRENDERLIMIT = u"Quadratic3DRenderLimit";
-constexpr OUStringLiteral PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT = u"QuadraticFormControlRenderLimit";
-
-// #i97672# selection settings
-constexpr OUStringLiteral PROPERTYNAME_TRANSPARENTSELECTION = u"TransparentSelection";
-constexpr OUStringLiteral PROPERTYNAME_TRANSPARENTSELECTIONPERCENT = u"TransparentSelectionPercent";
-constexpr OUStringLiteral PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT = u"SelectionMaximumLuminancePercent";
-
-#define PROPERTYHANDLE_OVERLAYBUFFER 0
-#define PROPERTYHANDLE_PAINTBUFFER 1
-#define PROPERTYHANDLE_STRIPE_COLOR_A 2
-#define PROPERTYHANDLE_STRIPE_COLOR_B 3
-#define PROPERTYHANDLE_STRIPE_LENGTH 4
-
-// #i73602#
-#define PROPERTYHANDLE_OVERLAYBUFFER_CALC 5
-#define PROPERTYHANDLE_OVERLAYBUFFER_WRITER 6
-#define PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS 7
-
// #i74769#, #i75172#
-#define PROPERTYHANDLE_PAINTBUFFER_CALC 8
-#define PROPERTYHANDLE_PAINTBUFFER_WRITER 9
-#define PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS 10
-
// #i4219#
-#define PROPERTYHANDLE_MAXIMUMPAPERWIDTH 11
-#define PROPERTYHANDLE_MAXIMUMPAPERHEIGHT 12
-#define PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN 13
-#define PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN 14
-#define PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN 15
-#define PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN 16
-
-// primitives
-#define PROPERTYHANDLE_ANTIALIASING 17
-#define PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE 18
-#define PROPERTYHANDLE_SOLIDDRAGCREATE 19
-#define PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT 20
-#define PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT 21
-#define PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT 22
-#define PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT 23
-
-// #i97672# selection settings
-#define PROPERTYHANDLE_TRANSPARENTSELECTION 24
-#define PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT 25
-#define PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT 26
-
-#define PROPERTYCOUNT 27
-
-class SvtOptionsDrawinglayer_Impl : public ConfigItem
-{
-public:
- SvtOptionsDrawinglayer_Impl();
- ~SvtOptionsDrawinglayer_Impl() override;
-
- virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames) override;
-
- bool IsOverlayBuffer() const { return m_bOverlayBuffer;}
- bool IsPaintBuffer() const { return m_bPaintBuffer;}
- const Color& GetStripeColorA() const { return m_bStripeColorA;}
- const Color& GetStripeColorB() const { return m_bStripeColorB;}
- sal_uInt16 GetStripeLength() const { return m_nStripeLength;}
-
- // #i73602#
- bool IsOverlayBuffer_Calc() const { return m_bOverlayBuffer_Calc;}
- bool IsOverlayBuffer_Writer() const { return m_bOverlayBuffer_Writer;}
- bool IsOverlayBuffer_DrawImpress() const { return m_bOverlayBuffer_DrawImpress;}
-
- // #i74769#, #i75172#
- bool IsPaintBuffer_Calc() const { return m_bPaintBuffer_Calc;}
- bool IsPaintBuffer_Writer() const { return m_bPaintBuffer_Writer;}
- bool IsPaintBuffer_DrawImpress() const { return m_bPaintBuffer_DrawImpress;}
-
- // #i4219#
- sal_uInt32 GetMaximumPaperWidth() const { return m_nMaximumPaperWidth;}
- sal_uInt32 GetMaximumPaperHeight() const { return m_nMaximumPaperHeight;}
- sal_uInt32 GetMaximumPaperLeftMargin() const { return m_nMaximumPaperLeftMargin;}
- sal_uInt32 GetMaximumPaperRightMargin() const { return m_nMaximumPaperRightMargin;}
- sal_uInt32 GetMaximumPaperTopMargin() const { return m_nMaximumPaperTopMargin;}
- sal_uInt32 GetMaximumPaperBottomMargin() const { return m_nMaximumPaperBottomMargin;}
-
- // helper
- bool IsAAPossibleOnThisSystem() const;
-
- // primitives
- bool IsAntiAliasing() const { return m_bAntiAliasing;}
- bool IsSnapHorVerLinesToDiscrete() const { return m_bSnapHorVerLinesToDiscrete;}
- bool IsSolidDragCreate() const { return m_bSolidDragCreate;}
- bool IsRenderDecoratedTextDirect() const { return m_bRenderDecoratedTextDirect;}
- bool IsRenderSimpleTextDirect() const { return m_bRenderSimpleTextDirect;}
- sal_uInt32 GetQuadratic3DRenderLimit() const { return m_nQuadratic3DRenderLimit;}
- sal_uInt32 GetQuadraticFormControlRenderLimit() const { return m_nQuadraticFormControlRenderLimit;}
-
- void SetAntiAliasing( bool bState );
-
- // #i97672# selection settings
- bool IsTransparentSelection() const { return m_bTransparentSelection;}
- sal_uInt16 GetTransparentSelectionPercent() const { return m_nTransparentSelectionPercent;}
- sal_uInt16 GetSelectionMaximumLuminancePercent() const { return m_nSelectionMaximumLuminancePercent;}
-
-// private methods
-
-private:
- virtual void ImplCommit() final override;
-
- static Sequence< OUString > impl_GetPropertyNames();
-
-// private member
-
-private:
-
- bool m_bOverlayBuffer;
- bool m_bPaintBuffer;
- Color m_bStripeColorA;
- Color m_bStripeColorB;
- sal_uInt16 m_nStripeLength;
-
- // #i73602#
- bool m_bOverlayBuffer_Calc;
- bool m_bOverlayBuffer_Writer;
- bool m_bOverlayBuffer_DrawImpress;
-
- // #i74769#, #i75172#
- bool m_bPaintBuffer_Calc;
- bool m_bPaintBuffer_Writer;
- bool m_bPaintBuffer_DrawImpress;
-
- // #i4219#
- sal_uInt32 m_nMaximumPaperWidth;
- sal_uInt32 m_nMaximumPaperHeight;
- sal_uInt32 m_nMaximumPaperLeftMargin;
- sal_uInt32 m_nMaximumPaperRightMargin;
- sal_uInt32 m_nMaximumPaperTopMargin;
- sal_uInt32 m_nMaximumPaperBottomMargin;
-
- // primitives
- bool m_bAntiAliasing;
- bool m_bSnapHorVerLinesToDiscrete;
- bool m_bSolidDragCreate;
- bool m_bRenderDecoratedTextDirect;
- bool m_bRenderSimpleTextDirect;
- sal_uInt32 m_nQuadratic3DRenderLimit;
- sal_uInt32 m_nQuadraticFormControlRenderLimit;
-
- // #i97672# selection settings
- sal_uInt16 m_nTransparentSelectionPercent;
- sal_uInt16 m_nSelectionMaximumLuminancePercent;
- bool m_bTransparentSelection;
-
- // local values
- bool m_bAllowAA : 1;
- bool m_bAllowAAChecked : 1;
-};
-
-SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl() :
- ConfigItem( ROOTNODE_START ),
- m_bOverlayBuffer( DEFAULT_OVERLAYBUFFER ),
- m_bPaintBuffer( DEFAULT_PAINTBUFFER ),
- m_bStripeColorA(DEFAULT_STRIPE_COLOR_A),
- m_bStripeColorB(DEFAULT_STRIPE_COLOR_B),
- m_nStripeLength(DEFAULT_STRIPE_LENGTH),
-
- // #i73602#
- m_bOverlayBuffer_Calc( DEFAULT_OVERLAYBUFFER_CALC ),
- m_bOverlayBuffer_Writer( DEFAULT_OVERLAYBUFFER_WRITER ),
- m_bOverlayBuffer_DrawImpress( DEFAULT_OVERLAYBUFFER_DRAWIMPRESS ),
-
- // #i74769#, #i75172#
- m_bPaintBuffer_Calc( DEFAULT_PAINTBUFFER_CALC ),
- m_bPaintBuffer_Writer( DEFAULT_PAINTBUFFER_WRITER ),
- m_bPaintBuffer_DrawImpress( DEFAULT_PAINTBUFFER_DRAWIMPRESS ),
-
- // #i4219#
- m_nMaximumPaperWidth(DEFAULT_MAXIMUMPAPERWIDTH),
- m_nMaximumPaperHeight(DEFAULT_MAXIMUMPAPERHEIGHT),
- m_nMaximumPaperLeftMargin(DEFAULT_MAXIMUMPAPERLEFTMARGIN),
- m_nMaximumPaperRightMargin(DEFAULT_MAXIMUMPAPERRIGHTMARGIN),
- m_nMaximumPaperTopMargin(DEFAULT_MAXIMUMPAPERTOPMARGIN),
- m_nMaximumPaperBottomMargin(DEFAULT_MAXIMUMPAPERBOTTOMMARGIN),
-
- // primitives
- m_bAntiAliasing(DEFAULT_ANTIALIASING),
- m_bSnapHorVerLinesToDiscrete(DEFAULT_SNAPHORVERLINESTODISCRETE),
- m_bSolidDragCreate(DEFAULT_SOLIDDRAGCREATE),
- m_bRenderDecoratedTextDirect(DEFAULT_RENDERDECORATEDTEXTDIRECT),
- m_bRenderSimpleTextDirect(DEFAULT_RENDERSIMPLETEXTDIRECT),
- m_nQuadratic3DRenderLimit(DEFAULT_QUADRATIC3DRENDERLIMIT),
- m_nQuadraticFormControlRenderLimit(DEFAULT_QUADRATICFORMCONTROLRENDERLIMIT),
-
- // #i97672# selection settings
- m_nTransparentSelectionPercent(DEFAULT_TRANSPARENTSELECTIONPERCENT),
- m_nSelectionMaximumLuminancePercent(DEFAULT_SELECTIONMAXIMUMLUMINANCEPERCENT),
- m_bTransparentSelection(DEFAULT_TRANSPARENTSELECTION),
-
- // local values
- m_bAllowAA(true),
- m_bAllowAAChecked(false)
-{
- Sequence< OUString > seqNames( impl_GetPropertyNames() );
- Sequence< Any > seqValues = GetProperties( seqNames ) ;
-
- DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nI miss some values of configuration keys!\n" );
-
- // Copy values from list in right order to our internal member.
- sal_Int32 nPropertyCount = seqValues.getLength();
- for(sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
- {
- if (!seqValues[nProperty].hasValue())
- continue;
-
- switch( nProperty )
- {
- case PROPERTYHANDLE_OVERLAYBUFFER:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer\"?" );
- seqValues[nProperty] >>= m_bOverlayBuffer;
- }
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer\"?" );
- seqValues[nProperty] >>= m_bPaintBuffer;
- }
- break;
-
- case PROPERTYHANDLE_STRIPE_COLOR_A:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorA\"?" );
- Color nValue;
- seqValues[nProperty] >>= nValue;
- m_bStripeColorA = nValue;
- }
- break;
-
- case PROPERTYHANDLE_STRIPE_COLOR_B:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeColorB\"?" );
- Color nValue;
- seqValues[nProperty] >>= nValue;
- m_bStripeColorB = nValue;
- }
- break;
-
- case PROPERTYHANDLE_STRIPE_LENGTH:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\StripeLength\"?" );
- seqValues[nProperty] >>= m_nStripeLength;
- }
- break;
-
- // #i73602#
- case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Calc\"?" );
- seqValues[nProperty] >>= m_bOverlayBuffer_Calc;
- }
- break;
-
- case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_Writer\"?" );
- seqValues[nProperty] >>= m_bOverlayBuffer_Writer;
- }
- break;
-
- case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\OverlayBuffer_DrawImpress\"?" );
- seqValues[nProperty] >>= m_bOverlayBuffer_DrawImpress;
- }
- break;
-
- // #i74769#, #i75172#
- case PROPERTYHANDLE_PAINTBUFFER_CALC:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Calc\"?" );
- seqValues[nProperty] >>= m_bPaintBuffer_Calc;
- }
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER_WRITER:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_Writer\"?" );
- seqValues[nProperty] >>= m_bPaintBuffer_Writer;
- }
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\PaintBuffer_DrawImpress\"?" );
- seqValues[nProperty] >>= m_bPaintBuffer_DrawImpress;
- }
- break;
-
- // #i4219#
- case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperWidth\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperWidth;
- }
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperHeight\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperHeight;
- }
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperLeftMargin\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperLeftMargin;
- }
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperRightMargin\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperRightMargin;
- }
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperTopMargin\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperTopMargin;
- }
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\MaximumPaperBottomMargin\"?" );
- seqValues[nProperty] >>= m_nMaximumPaperBottomMargin;
- }
- break;
-
- // primitives
- case PROPERTYHANDLE_ANTIALIASING:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\AntiAliasing\"?" );
- seqValues[nProperty] >>= m_bAntiAliasing;
- }
- break;
-
- // primitives
- case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SnapHorVerLinesToDiscrete\"?" );
- seqValues[nProperty] >>= m_bSnapHorVerLinesToDiscrete;
- }
- break;
-
- case PROPERTYHANDLE_SOLIDDRAGCREATE:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SolidDragCreate\"?" );
- seqValues[nProperty] >>= m_bSolidDragCreate;
- }
- break;
-
- case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderDecoratedTextDirect\"?" );
- seqValues[nProperty] >>= m_bRenderDecoratedTextDirect;
- }
- break;
-
- case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\RenderSimpleTextDirect\"?" );
- seqValues[nProperty] >>= m_bRenderSimpleTextDirect;
- }
- break;
-
- case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\Quadratic3DRenderLimit\"?" );
- seqValues[nProperty] >>= m_nQuadratic3DRenderLimit;
- }
- break;
-
- case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_LONG), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\QuadraticFormControlRenderLimit\"?" );
- seqValues[nProperty] >>= m_nQuadraticFormControlRenderLimit;
- }
- break;
-
- // #i97672# selection settings
- case PROPERTYHANDLE_TRANSPARENTSELECTION:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelection\"?" );
- seqValues[nProperty] >>= m_bTransparentSelection;
- }
- break;
-
- case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\TransparentSelectionPercent\"?" );
- seqValues[nProperty] >>= m_nTransparentSelectionPercent;
- }
- break;
-
- case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
- {
- DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SHORT), "SvtOptionsDrawinglayer_Impl::SvtOptionsDrawinglayer_Impl()\nWho has changed the value type of \"Office.Common\\Drawinglayer\\SelectionMaximumLuminancePercent\"?" );
- seqValues[nProperty] >>= m_nSelectionMaximumLuminancePercent;
- }
- break;
- }
- }
-}
-
-SvtOptionsDrawinglayer_Impl::~SvtOptionsDrawinglayer_Impl()
-{
- if (IsModified())
- Commit();
-}
-
-// Commit
-
-void SvtOptionsDrawinglayer_Impl::ImplCommit()
-{
- Sequence< OUString > aSeqNames( impl_GetPropertyNames() );
- Sequence< Any > aSeqValues( aSeqNames.getLength() );
-
- for( sal_Int32 nProperty = 0, nCount = aSeqNames.getLength(); nProperty < nCount; ++nProperty )
- {
- switch( nProperty )
- {
- case PROPERTYHANDLE_OVERLAYBUFFER:
- aSeqValues[nProperty] <<= m_bOverlayBuffer;
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER:
- aSeqValues[nProperty] <<= m_bPaintBuffer;
- break;
-
- case PROPERTYHANDLE_STRIPE_COLOR_A:
- aSeqValues[nProperty] <<= m_bStripeColorA;
- break;
-
- case PROPERTYHANDLE_STRIPE_COLOR_B:
- aSeqValues[nProperty] <<= m_bStripeColorB;
- break;
-
- case PROPERTYHANDLE_STRIPE_LENGTH:
- aSeqValues[nProperty] <<= m_nStripeLength;
- break;
-
- // #i73602#
- case PROPERTYHANDLE_OVERLAYBUFFER_CALC:
- aSeqValues[nProperty] <<= m_bOverlayBuffer_Calc;
- break;
-
- case PROPERTYHANDLE_OVERLAYBUFFER_WRITER:
- aSeqValues[nProperty] <<= m_bOverlayBuffer_Writer;
- break;
-
- case PROPERTYHANDLE_OVERLAYBUFFER_DRAWIMPRESS:
- aSeqValues[nProperty] <<= m_bOverlayBuffer_DrawImpress;
- break;
-
- // #i74769#, #i75172#
- case PROPERTYHANDLE_PAINTBUFFER_CALC:
- aSeqValues[nProperty] <<= m_bPaintBuffer_Calc;
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER_WRITER:
- aSeqValues[nProperty] <<= m_bPaintBuffer_Writer;
- break;
-
- case PROPERTYHANDLE_PAINTBUFFER_DRAWIMPRESS:
- aSeqValues[nProperty] <<= m_bPaintBuffer_DrawImpress;
- break;
-
- // #i4219#
- case PROPERTYHANDLE_MAXIMUMPAPERWIDTH:
- aSeqValues[nProperty] <<= m_nMaximumPaperWidth;
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERHEIGHT:
- aSeqValues[nProperty] <<= m_nMaximumPaperHeight;
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERLEFTMARGIN:
- aSeqValues[nProperty] <<= m_nMaximumPaperLeftMargin;
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERRIGHTMARGIN:
- aSeqValues[nProperty] <<= m_nMaximumPaperRightMargin;
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERTOPMARGIN:
- aSeqValues[nProperty] <<= m_nMaximumPaperTopMargin;
- break;
-
- case PROPERTYHANDLE_MAXIMUMPAPERBOTTOMMARGIN:
- aSeqValues[nProperty] <<= m_nMaximumPaperBottomMargin;
- break;
-
- // primitives
- case PROPERTYHANDLE_ANTIALIASING:
- aSeqValues[nProperty] <<= m_bAntiAliasing;
- break;
-
- case PROPERTYHANDLE_SNAPHORVERLINESTODISCRETE:
- aSeqValues[nProperty] <<= m_bSnapHorVerLinesToDiscrete;
- break;
-
- case PROPERTYHANDLE_SOLIDDRAGCREATE:
- aSeqValues[nProperty] <<= m_bSolidDragCreate;
- break;
-
- case PROPERTYHANDLE_RENDERDECORATEDTEXTDIRECT:
- aSeqValues[nProperty] <<= m_bRenderDecoratedTextDirect;
- break;
-
- case PROPERTYHANDLE_RENDERSIMPLETEXTDIRECT:
- aSeqValues[nProperty] <<= m_bRenderSimpleTextDirect;
- break;
-
- case PROPERTYHANDLE_QUADRATIC3DRENDERLIMIT:
- aSeqValues[nProperty] <<= m_nQuadratic3DRenderLimit;
- break;
-
- case PROPERTYHANDLE_QUADRATICFORMCONTROLRENDERLIMIT:
- aSeqValues[nProperty] <<= m_nQuadraticFormControlRenderLimit;
- break;
-
- // #i97672# selection settings
- case PROPERTYHANDLE_TRANSPARENTSELECTION:
- aSeqValues[nProperty] <<= m_bTransparentSelection;
- break;
-
- case PROPERTYHANDLE_TRANSPARENTSELECTIONPERCENT:
- aSeqValues[nProperty] <<= m_nTransparentSelectionPercent;
- break;
-
- case PROPERTYHANDLE_SELECTIONMAXIMUMLUMINANCEPERCENT:
- aSeqValues[nProperty] <<= m_nSelectionMaximumLuminancePercent;
- break;
- }
- }
-
- PutProperties( aSeqNames, aSeqValues );
-}
-void SvtOptionsDrawinglayer_Impl::Notify( const css::uno::Sequence<OUString>& )
+namespace SvtOptionsDrawinglayer
{
-}
-// #i73602#
-
-// #i74769#, #i75172#
-
-// #i4219#
// helper
-bool SvtOptionsDrawinglayer_Impl::IsAAPossibleOnThisSystem() const
-{
- if(!m_bAllowAAChecked)
- {
- SvtOptionsDrawinglayer_Impl* pThat = const_cast< SvtOptionsDrawinglayer_Impl* >(this);
- pThat->m_bAllowAAChecked = true;
-
-#ifdef _WIN32
- // WIN32 uses GDIPlus with VCL for the first incarnation; this will be enhanced
- // in the future to use canvases and the canvas renderer, thus an AA-abled
- // canvas needs to be checked here in the future.
- // Currently, just allow AA for WIN32
-#endif
-
- // check XRenderExtension
- if(m_bAllowAA && !Application::GetDefaultDevice()->SupportsOperation( OutDevSupportType::TransparentRect ))
- {
- pThat->m_bAllowAA = false;
- }
- }
-
- return m_bAllowAA;
-}
-
-// primitives
-
-void SvtOptionsDrawinglayer_Impl::SetAntiAliasing( bool bState )
-{
- if(m_bAntiAliasing != bState)
- {
- m_bAntiAliasing = bState;
- SetModified();
- }
-}
-
-// private method
-
-Sequence< OUString > SvtOptionsDrawinglayer_Impl::impl_GetPropertyNames()
-{
- // Build list of configuration key names.
- const OUString pProperties[] =
- {
- PROPERTYNAME_OVERLAYBUFFER ,
- PROPERTYNAME_PAINTBUFFER ,
- PROPERTYNAME_STRIPE_COLOR_A ,
- PROPERTYNAME_STRIPE_COLOR_B ,
- PROPERTYNAME_STRIPE_LENGTH ,
-
- // #i73602#
- PROPERTYNAME_OVERLAYBUFFER_CALC,
- PROPERTYNAME_OVERLAYBUFFER_WRITER,
- PROPERTYNAME_OVERLAYBUFFER_DRAWIMPRESS,
-
- // #i74769#, #i75172#
- PROPERTYNAME_PAINTBUFFER_CALC,
- PROPERTYNAME_PAINTBUFFER_WRITER,
- PROPERTYNAME_PAINTBUFFER_DRAWIMPRESS,
-
- // #i4219#
- PROPERTYNAME_MAXIMUMPAPERWIDTH,
- PROPERTYNAME_MAXIMUMPAPERHEIGHT,
- PROPERTYNAME_MAXIMUMPAPERLEFTMARGIN,
- PROPERTYNAME_MAXIMUMPAPERRIGHTMARGIN,
- PROPERTYNAME_MAXIMUMPAPERTOPMARGIN,
- PROPERTYNAME_MAXIMUMPAPERBOTTOMMARGIN,
-
- // primitives
- PROPERTYNAME_ANTIALIASING,
- PROPERTYNAME_SNAPHORVERLINESTODISCRETE,
- PROPERTYNAME_SOLIDDRAGCREATE,
- PROPERTYNAME_RENDERDECORATEDTEXTDIRECT,
- PROPERTYNAME_RENDERSIMPLETEXTDIRECT,
- PROPERTYNAME_QUADRATIC3DRENDERLIMIT,
- PROPERTYNAME_QUADRATICFORMCONTROLRENDERLIMIT,
-
- // #i97672# selection settings
- PROPERTYNAME_TRANSPARENTSELECTION,
- PROPERTYNAME_TRANSPARENTSELECTIONPERCENT,
- PROPERTYNAME_SELECTIONMAXIMUMLUMINANCEPERCENT
- };
-
- // Initialize return sequence with these list ...
- const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
- // ... and return it.
- return seqPropertyNames;
-}
-
-namespace {
- //global
- std::weak_ptr<SvtOptionsDrawinglayer_Impl> g_pOptionsDrawinglayer;
-}
-
-SvtOptionsDrawinglayer::SvtOptionsDrawinglayer()
-{
- // Global access, must be guarded (multithreading!).
- MutexGuard aGuard( GetOwnStaticMutex() );
- m_pImpl = g_pOptionsDrawinglayer.lock();
- if( !m_pImpl )
- {
- m_pImpl = std::make_shared<SvtOptionsDrawinglayer_Impl>();
- g_pOptionsDrawinglayer = m_pImpl;
- }
-}
-
-SvtOptionsDrawinglayer::~SvtOptionsDrawinglayer()
+bool IsAAPossibleOnThisSystem()
{
- // Global access, must be guarded (multithreading!)
- MutexGuard aGuard( GetOwnStaticMutex() );
-
- m_pImpl.reset();
+ return !Application::GetDefaultDevice()->SupportsOperation( OutDevSupportType::TransparentRect );
}
-// public method
-
-bool SvtOptionsDrawinglayer::IsOverlayBuffer() const
+bool IsOverlayBuffer()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsOverlayBuffer();
+ return officecfg::Office::Common::Drawinglayer::OverlayBuffer::get();
}
-// public method
-
-bool SvtOptionsDrawinglayer::IsPaintBuffer() const
+bool IsPaintBuffer()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsPaintBuffer();
+ return officecfg::Office::Common::Drawinglayer::PaintBuffer::get();
}
-// public method
-
-Color SvtOptionsDrawinglayer::GetStripeColorA() const
+Color GetStripeColorA()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetStripeColorA();
+ return Color(ColorTransparency, officecfg::Office::Common::Drawinglayer::StripeColorA::get());
}
-// public method
-
-Color SvtOptionsDrawinglayer::GetStripeColorB() const
+Color GetStripeColorB()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetStripeColorB();
+ return Color(ColorTransparency, officecfg::Office::Common::Drawinglayer::StripeColorB::get());
}
-// public method
-
-sal_uInt16 SvtOptionsDrawinglayer::GetStripeLength() const
+sal_uInt16 GetStripeLength()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetStripeLength();
+ return officecfg::Office::Common::Drawinglayer::StripeLength::get();
}
-// #i73602#
-bool SvtOptionsDrawinglayer::IsOverlayBuffer_Calc() const
+bool IsOverlayBuffer_Calc()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsOverlayBuffer_Calc();
+ return officecfg::Office::Common::Drawinglayer::OverlayBuffer_Calc::get();
}
-bool SvtOptionsDrawinglayer::IsOverlayBuffer_Writer() const
+bool IsOverlayBuffer_Writer()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsOverlayBuffer_Writer();
+ return officecfg::Office::Common::Drawinglayer::OverlayBuffer_Writer::get();
}
-bool SvtOptionsDrawinglayer::IsOverlayBuffer_DrawImpress() const
+bool IsOverlayBuffer_DrawImpress()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsOverlayBuffer_DrawImpress();
+ return officecfg::Office::Common::Drawinglayer::OverlayBuffer_DrawImpress::get();
}
// #i74769#, #i75172#
-bool SvtOptionsDrawinglayer::IsPaintBuffer_Calc() const
+bool IsPaintBuffer_Calc()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsPaintBuffer_Calc();
+ return officecfg::Office::Common::Drawinglayer::PaintBuffer_Calc::get();
}
-bool SvtOptionsDrawinglayer::IsPaintBuffer_Writer() const
+bool IsPaintBuffer_Writer()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsPaintBuffer_Writer();
+ return officecfg::Office::Common::Drawinglayer::PaintBuffer_Writer::get();
}
-bool SvtOptionsDrawinglayer::IsPaintBuffer_DrawImpress() const
+bool IsPaintBuffer_DrawImpress()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsPaintBuffer_DrawImpress();
+ return officecfg::Office::Common::Drawinglayer::PaintBuffer_DrawImpress::get();
}
// #i4219#
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperWidth() const
+sal_uInt32 GetMaximumPaperWidth()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperWidth();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperWidth::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperHeight() const
+sal_uInt32 GetMaximumPaperHeight()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperHeight();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperHeight::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperLeftMargin() const
+sal_uInt32 GetMaximumPaperLeftMargin()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperLeftMargin();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperLeftMargin::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperRightMargin() const
+sal_uInt32 GetMaximumPaperRightMargin()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperRightMargin();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperRightMargin::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperTopMargin() const
+sal_uInt32 GetMaximumPaperTopMargin()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperTopMargin();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperTopMargin::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetMaximumPaperBottomMargin() const
+sal_uInt32 GetMaximumPaperBottomMargin()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetMaximumPaperBottomMargin();
+ return officecfg::Office::Common::Drawinglayer::MaximumPaperBottomMargin::get();
}
-// helper
-bool SvtOptionsDrawinglayer::IsAAPossibleOnThisSystem() const
-{
- return m_pImpl->IsAAPossibleOnThisSystem();
-}
+static std::mutex gaAntiAliasMutex;
+static bool bAntiAliasingInit = false;
+static bool bAntiAliasing = false;
-// primitives
-bool SvtOptionsDrawinglayer::IsAntiAliasing() const
+bool IsAntiAliasing()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsAntiAliasing() && IsAAPossibleOnThisSystem();
+ std::lock_guard aGuard(gaAntiAliasMutex);
+ if (!bAntiAliasingInit)
+ {
+ bAntiAliasingInit = true;
+ bAntiAliasing = officecfg::Office::Common::Drawinglayer::AntiAliasing::get()
+ && IsAAPossibleOnThisSystem();
+ }
+ return bAntiAliasing;
}
-bool SvtOptionsDrawinglayer::IsSnapHorVerLinesToDiscrete() const
+/**
+ * Some code like to turn this stuff on and off during a drawing operation
+ * so it can "tunnel" information down through several layers,
+ * so we don't want to actually do a config write all the time.
+ */
+void SetAntiAliasing( bool bOn, bool bTemporary )
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsAntiAliasing() && m_pImpl->IsSnapHorVerLinesToDiscrete();
+ std::lock_guard aGuard(gaAntiAliasMutex);
+ if (!bTemporary)
+ {
+ std::shared_ptr<comphelper::ConfigurationChanges> batch =
+ comphelper::ConfigurationChanges::create();
+ officecfg::Office::Common::Drawinglayer::AntiAliasing::set(bOn, batch);
+ batch->commit();
+ }
+ bAntiAliasing = bOn;
}
-bool SvtOptionsDrawinglayer::IsSolidDragCreate() const
+
+bool IsSnapHorVerLinesToDiscrete()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsSolidDragCreate();
+ return IsAntiAliasing() && officecfg::Office::Common::Drawinglayer::SnapHorVerLinesToDiscrete::get();
}
-bool SvtOptionsDrawinglayer::IsRenderDecoratedTextDirect() const
+bool IsSolidDragCreate()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsRenderDecoratedTextDirect();
+ return officecfg::Office::Common::Drawinglayer::SolidDragCreate::get();
}
-bool SvtOptionsDrawinglayer::IsRenderSimpleTextDirect() const
+bool IsRenderDecoratedTextDirect()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsRenderSimpleTextDirect();
+ return officecfg::Office::Common::Drawinglayer::RenderDecoratedTextDirect::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetQuadratic3DRenderLimit() const
+bool IsRenderSimpleTextDirect()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetQuadratic3DRenderLimit();
+ return officecfg::Office::Common::Drawinglayer::RenderSimpleTextDirect::get();
}
-sal_uInt32 SvtOptionsDrawinglayer::GetQuadraticFormControlRenderLimit() const
+sal_uInt32 GetQuadratic3DRenderLimit()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->GetQuadraticFormControlRenderLimit();
+ return officecfg::Office::Common::Drawinglayer::Quadratic3DRenderLimit::get();
}
-void SvtOptionsDrawinglayer::SetAntiAliasing( bool bState )
+sal_uInt32 GetQuadraticFormControlRenderLimit()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- m_pImpl->SetAntiAliasing( bState );
+ return officecfg::Office::Common::Drawinglayer::QuadraticFormControlRenderLimit::get();
}
// #i97672# selection settings
-bool SvtOptionsDrawinglayer::IsTransparentSelection() const
+bool IsTransparentSelection()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- return m_pImpl->IsTransparentSelection();
+ return officecfg::Office::Common::Drawinglayer::TransparentSelection::get();
}
-sal_uInt16 SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
+sal_uInt16 GetTransparentSelectionPercent()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- sal_uInt16 aRetval(m_pImpl->GetTransparentSelectionPercent());
+ sal_uInt16 aRetval = officecfg::Office::Common::Drawinglayer::TransparentSelectionPercent::get();
// crop to range [10% .. 90%]
if(aRetval < 10)
@@ -970,10 +214,9 @@ sal_uInt16 SvtOptionsDrawinglayer::GetTransparentSelectionPercent() const
return aRetval;
}
-sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
+sal_uInt16 GetSelectionMaximumLuminancePercent()
{
- MutexGuard aGuard( GetOwnStaticMutex() );
- sal_uInt16 aRetval(m_pImpl->GetSelectionMaximumLuminancePercent());
+ sal_uInt16 aRetval = officecfg::Office::Common::Drawinglayer::SelectionMaximumLuminancePercent::get();
// crop to range [0% .. 100%]
if(aRetval > 90)
@@ -984,7 +227,7 @@ sal_uInt16 SvtOptionsDrawinglayer::GetSelectionMaximumLuminancePercent() const
return aRetval;
}
-Color SvtOptionsDrawinglayer::getHilightColor() const
+Color getHilightColor()
{
Color aRetval(Application::GetSettings().GetStyleSettings().GetHighlightColor());
const basegfx::BColor aSelection(aRetval.getBColor());
@@ -1005,16 +248,6 @@ Color SvtOptionsDrawinglayer::getHilightColor() const
return aRetval;
}
-namespace
-{
- class theOptionsDrawinglayerMutex : public rtl::Static<osl::Mutex, theOptionsDrawinglayerMutex>{};
-}
-
-// private method
-
-Mutex& SvtOptionsDrawinglayer::GetOwnStaticMutex()
-{
- return theOptionsDrawinglayerMutex::get();
-}
+} // namespace SvtOptionsDrawinglayer
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/dialog/weldeditview.cxx b/svx/source/dialog/weldeditview.cxx
index 04f4ce390ca2..7059ada36320 100644
--- a/svx/source/dialog/weldeditview.cxx
+++ b/svx/source/dialog/weldeditview.cxx
@@ -229,8 +229,7 @@ void WeldEditView::DoPaint(vcl::RenderContext& rRenderContext, const tools::Rect
}
// get the system's highlight color
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+ const Color aHighlight(SvtOptionsDrawinglayer::getHilightColor());
sdr::overlay::OverlaySelection aCursorOverlay(sdr::overlay::OverlayType::Transparent,
aHighlight, aLogicRanges, true);
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index 5d2b0f1a4494..00e3f1054bd9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -102,9 +102,8 @@ namespace sdr::contact
//But, see tdf#97276, tdf#126184 and tdf#98366. Don't clip too much if the
//underlying page dimension is unknown or a paste document
//where the page sizes use the odd default of 10x10
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
- const sal_Int32 nMaxPaperWidth = aDrawinglayerOpt.GetMaximumPaperWidth() * 1000;
- const sal_Int32 nMaxPaperHeight = aDrawinglayerOpt.GetMaximumPaperHeight() * 1000;
+ const sal_Int32 nMaxPaperWidth = SvtOptionsDrawinglayer::GetMaximumPaperWidth() * 1000;
+ const sal_Int32 nMaxPaperHeight = SvtOptionsDrawinglayer::GetMaximumPaperHeight() * 1000;
nPageWidth = std::max<sal_Int32>(nPageWidth, nMaxPaperWidth);
nPageHeight = std::max<sal_Int32>(nPageHeight, nMaxPaperHeight);
basegfx::B2DRange aClipRange(-nPageWidth, -nPageHeight,
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx
index edf2852c8eef..6965b6a775a0 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -27,6 +27,7 @@
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processor2dtools.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <memory>
@@ -43,7 +44,7 @@ namespace sdr::overlay
return;
const AntialiasingFlags nOriginalAA(rDestinationDevice.GetAntialiasing());
- const bool bIsAntiAliasing(getDrawinglayerOpt().IsAntiAliasing());
+ const bool bIsAntiAliasing(SvtOptionsDrawinglayer::IsAntiAliasing());
// create processor
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
@@ -117,7 +118,6 @@ namespace sdr::overlay
maStripeColorA(COL_BLACK),
maStripeColorB(COL_WHITE),
mnStripeLengthPixel(5),
- maDrawinglayerOpt(),
maViewTransformation(),
maViewInformation2D(),
mfDiscreteOne(0.0)
@@ -282,7 +282,7 @@ namespace sdr::overlay
if (rRange.isEmpty()) {
return {};
}
- if (getDrawinglayerOpt().IsAntiAliasing())
+ if (SvtOptionsDrawinglayer::IsAntiAliasing())
{
// assume AA needs one pixel more and invalidate one pixel more
const double fDiscreteOne(getDiscreteOne());
diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
index 71c8d6f73f47..05f6c1b592aa 100644
--- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
+++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx
@@ -24,6 +24,7 @@
#include <vcl/window.hxx>
#include <tools/fract.hxx>
#include <vcl/cursor.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
namespace sdr::overlay
@@ -412,7 +413,7 @@ namespace sdr::overlay
basegfx::B2DRange aDiscreteRange(rRange);
aDiscreteRange.transform(getOutputDevice().GetViewTransformation());
- if(maDrawinglayerOpt.IsAntiAliasing())
+ if(SvtOptionsDrawinglayer::IsAntiAliasing())
{
// assume AA needs one pixel more and invalidate one pixel more
const double fDiscreteOne(getDiscreteOne());
diff --git a/svx/source/sdr/overlay/overlaypolypolygon.cxx b/svx/source/sdr/overlay/overlaypolypolygon.cxx
index f71b664b7a06..9b6abd8beb8a 100644
--- a/svx/source/sdr/overlay/overlaypolypolygon.cxx
+++ b/svx/source/sdr/overlay/overlaypolypolygon.cxx
@@ -24,6 +24,7 @@
#include <drawinglayer/primitive2d/PolyPolygonStrokePrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
namespace sdr::overlay
@@ -88,9 +89,8 @@ namespace sdr::overlay
aRetval = drawinglayer::primitive2d::Primitive2DContainer { aStriped };
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
const drawinglayer::primitive2d::Primitive2DReference aFilled(
new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
diff --git a/svx/source/sdr/overlay/overlayrollingrectangle.cxx b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
index 1619139dbb0f..f03380eddf0f 100644
--- a/svx/source/sdr/overlay/overlayrollingrectangle.cxx
+++ b/svx/source/sdr/overlay/overlayrollingrectangle.cxx
@@ -24,6 +24,7 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/PolyPolygonMarkerPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonSelectionPrimitive2D.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
namespace sdr::overlay
{
@@ -50,9 +51,8 @@ namespace sdr::overlay
aRGBColorB,
fStripeLengthPixel);
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
basegfx::B2DPolyPolygon(aPolygon),
diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx
index 4abcd2bd7182..8a3968def14c 100644
--- a/svx/source/sdr/overlay/overlayselection.cxx
+++ b/svx/source/sdr/overlay/overlayselection.cxx
@@ -63,9 +63,7 @@ namespace sdr::overlay
{
if(OverlayType::Invert != aOverlayType)
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
-
- if(!aSvtOptionsDrawinglayer.IsTransparentSelection())
+ if(!SvtOptionsDrawinglayer::IsTransparentSelection())
{
// not possible when switched off by user
return OverlayType::Invert;
@@ -186,8 +184,7 @@ namespace sdr::overlay
{
// get current values
const OverlayType aNewOverlayType(impCheckPossibleOverlayType(meOverlayType));
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const sal_uInt16 nNewTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent());
+ const sal_uInt16 nNewTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent());
if(!getPrimitive2DSequence().empty())
{
diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx
index 788d47ab79e5..108ca6bff18b 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -31,6 +31,7 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/fmview.hxx>
#include <sfx2/lokhelper.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <tools/debug.hxx>
#include <vcl/window.hxx>
@@ -428,12 +429,11 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
{
if (GetPageView().IsVisible() && GetPaintWindow().OutputToWindow())
{
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
OutputDevice& rWindow(GetPaintWindow().GetOutputDevice());
basegfx::B2DRange aDiscreteRange(rRange);
aDiscreteRange.transform(rWindow.GetViewTransformation());
- if (aDrawinglayerOpt.IsAntiAliasing())
+ if (SvtOptionsDrawinglayer::IsAntiAliasing())
{
// invalidate one discrete unit more under the assumption that AA
// needs one pixel more
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index c3dcee32b4f7..171f8348b9ac 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -26,6 +26,7 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/window.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <set>
#include <vector>
@@ -173,10 +174,10 @@ void SdrPreRenderDevice::OutputPreRenderDevice(const vcl::Region& rExpandedRegio
mpPreRenderDevice->EnableMapMode(bMapModeWasEnabledSource);
}
-void SdrPaintView::InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager) const
+void SdrPaintView::InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManager> xOverlayManager)
{
- Color aColA(getOptionsDrawinglayer().GetStripeColorA());
- Color aColB(getOptionsDrawinglayer().GetStripeColorB());
+ Color aColA(SvtOptionsDrawinglayer::GetStripeColorA());
+ Color aColB(SvtOptionsDrawinglayer::GetStripeColorB());
if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
@@ -186,7 +187,7 @@ void SdrPaintView::InitOverlayManager(rtl::Reference<sdr::overlay::OverlayManage
xOverlayManager->setStripeColorA(aColA);
xOverlayManager->setStripeColorB(aColB);
- xOverlayManager->setStripeLengthPixel(getOptionsDrawinglayer().GetStripeLength());
+ xOverlayManager->setStripeLengthPixel(SvtOptionsDrawinglayer::GetStripeLength());
}
rtl::Reference<sdr::overlay::OverlayManager> SdrPaintView::CreateOverlayManager(OutputDevice& rOutputDevice) const
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index c1d965606d3f..b0ec9365712d 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -64,6 +64,7 @@
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrlinestartendattribute.hxx>
#include <svl/itempool.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <comphelper/lok.hxx>
#include <map>
#include <vector>
@@ -96,12 +97,11 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPolyPolygon::createP
if(maOriginalPolyPolygon.count())
{
basegfx::B2DPolyPolygon aCopy(maOriginalPolyPolygon);
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
rDragMethod.applyCurrentTransformationToPolyPolygon(aCopy);
- basegfx::BColor aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
- basegfx::BColor aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
- const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
+ basegfx::BColor aColA(SvtOptionsDrawinglayer::GetStripeColorA().getBColor());
+ basegfx::BColor aColB(SvtOptionsDrawinglayer::GetStripeColorB().getBColor());
+ const double fStripeLength(SvtOptionsDrawinglayer::GetStripeLength());
if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
@@ -116,8 +116,8 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPolyPolygon::createP
aColB,
fStripeLength);
- const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D(
aCopy,
@@ -244,8 +244,7 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPointGlueDrag::creat
if(mbIsPointDrag)
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- basegfx::BColor aColor(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
+ basegfx::BColor aColor(SvtOptionsDrawinglayer::GetStripeColorA().getBColor());
if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
@@ -921,10 +920,9 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragMethod::AddConnectorOverl
}
else
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- basegfx::BColor aColA(aSvtOptionsDrawinglayer.GetStripeColorA().getBColor());
- basegfx::BColor aColB(aSvtOptionsDrawinglayer.GetStripeColorB().getBColor());
- const double fStripeLength(aSvtOptionsDrawinglayer.GetStripeLength());
+ basegfx::BColor aColA(SvtOptionsDrawinglayer::GetStripeColorA().getBColor());
+ basegfx::BColor aColB(SvtOptionsDrawinglayer::GetStripeColorB().getBColor());
+ const double fStripeLength(SvtOptionsDrawinglayer::GetStripeLength());
if(Application::GetSettings().GetStyleSettings().GetHighContrastMode())
{
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 6cbba5494070..df67333f3429 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -33,6 +33,7 @@
#include <svx/svdoashp.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdrpagewindow.hxx>
#include <osl/diagnose.h>
@@ -50,7 +51,7 @@ SdrDragView::SdrDragView(SdrModel& rSdrModel, OutputDevice* pOut)
, mbDragLimit(false)
, mbDragHdl(false)
, mbDragStripes(false)
- , mbSolidDragging(getOptionsDrawinglayer().IsSolidDragCreate())
+ , mbSolidDragging(SvtOptionsDrawinglayer::IsSolidDragCreate())
, mbResizeAtCenter(false)
, mbCrookAtCenter(false)
, mbDragWithCopy(false)
@@ -911,7 +912,7 @@ bool SdrDragView::IsSolidDragging() const
{
// allow each user to disable by having a local setting, but using AND for
// checking allowance
- return mbSolidDragging && getOptionsDrawinglayer().IsSolidDragCreate();
+ return mbSolidDragging && SvtOptionsDrawinglayer::IsSolidDragCreate();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c11238a1b004..e7a3f18076f1 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -59,6 +59,7 @@
#include <svx/sdrundomanager.hxx>
#include <svx/strings.hrc>
#include <svx/svdviter.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <textchain.hxx>
#include <textchaincursor.hxx>
#include <tools/debug.hxx>
@@ -450,8 +451,7 @@ TextEditOverlayObject::createOverlayObjectPrimitive2DSequence()
/// outer frame visualization
if (mbVisualizeSurroundingFrame)
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
const sal_uInt16 nPixSiz(getOutlinerView().GetInvalidateMore() - 1);
aRetval.push_back(new drawinglayer::primitive2d::OverlayRectanglePrimitive(
@@ -777,9 +777,8 @@ void SdrObjEditView::ImpPaintOutlinerView(OutlinerView& rOutlView, const tools::
const bool bMapModeEnabled(rTargetDevice.IsMapModeEnabled());
const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(aPixRect);
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
const sal_uInt16 nPixSiz(rOutlView.GetInvalidateMore() - 1);
const drawinglayer::primitive2d::Primitive2DReference xReference(
new drawinglayer::primitive2d::OverlayRectanglePrimitive(
@@ -1232,8 +1231,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W
// LibreOfficeKit is active
pTextEditOutlinerView->GetEditView().setEditViewCallbacks(this);
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
+ const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor());
const SdrTextObj* pText = GetTextEditObject();
const bool bTextFrame(pText && pText->IsTextFrame());
const bool bFitToSize(pTextEditOutliner->GetControlWord()
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 92a68e5ada58..249557f35e26 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -62,6 +62,7 @@
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <memory>
#include <bitmaps.hlst>
@@ -1820,9 +1821,8 @@ void ImpTextframeHdl::CreateB2dIAObject()
{
const basegfx::B2DPoint aTopLeft(maRect.Left(), maRect.Top());
const basegfx::B2DPoint aBottomRight(maRect.Right(), maRect.Bottom());
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
std::unique_ptr<sdr::overlay::OverlayRectangle> pNewOverlayObject(new sdr::overlay::OverlayRectangle(
aTopLeft,
@@ -2621,8 +2621,7 @@ void SdrCropViewHdl::CreateB2dIAObject()
maGraphic));
// prepare outline polygon for whole graphic
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const basegfx::BColor aHilightColor(aSvtOptionsDrawinglayer.getHilightColor().getBColor());
+ const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor());
const drawinglayer::primitive2d::Primitive2DReference aGraphicOutline(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
aGraphicOutlinePolygon,
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index d396b521f2c9..495a0bd64c74 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -57,6 +57,7 @@
#include <sfx2/lokhelper.hxx>
#include <sfx2/lokcharthelper.hxx>
#include <sfx2/viewsh.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <array>
@@ -148,8 +149,7 @@ public:
if (xTargetOverlay.is())
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHighlightColor = aSvtOptionsDrawinglayer.getHilightColor();
+ const Color aHighlightColor = SvtOptionsDrawinglayer::getHilightColor();
std::unique_ptr<sdr::overlay::OverlaySelection> pNew =
std::make_unique<sdr::overlay::OverlaySelection>(
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index d67108df38de..3ae23ab2b478 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -44,6 +44,7 @@
#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <comphelper/lok.hxx>
#include <svx/svdviter.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
using namespace ::com::sun::star;
@@ -1146,7 +1147,7 @@ void SdrPaintView::SetApplicationDocumentColor(Color aDocumentColor)
bool SdrPaintView::IsBufferedOutputAllowed() const
{
- return (mbBufferedOutputAllowed && maDrawinglayerOpt.IsPaintBuffer());
+ return (mbBufferedOutputAllowed && SvtOptionsDrawinglayer::IsPaintBuffer());
}
void SdrPaintView::SetBufferedOutputAllowed(bool bNew)
@@ -1159,7 +1160,7 @@ void SdrPaintView::SetBufferedOutputAllowed(bool bNew)
bool SdrPaintView::IsBufferedOverlayAllowed() const
{
- return (mbBufferedOverlayAllowed && maDrawinglayerOpt.IsOverlayBuffer());
+ return (mbBufferedOverlayAllowed && SvtOptionsDrawinglayer::IsOverlayBuffer());
}
void SdrPaintView::SetBufferedOverlayAllowed(bool bNew)
diff --git a/svx/source/table/tablehandles.cxx b/svx/source/table/tablehandles.cxx
index 4322bf2ea6fe..cc57ccd030c5 100644
--- a/svx/source/table/tablehandles.cxx
+++ b/svx/source/table/tablehandles.cxx
@@ -33,6 +33,7 @@
#include <drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx>
#include <sdr/overlay/overlayrectangle.hxx>
#include <drawinglayer/primitive2d/hiddengeometryprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
namespace sdr::table {
@@ -279,9 +280,8 @@ void TableBorderHdl::CreateB2dIAObject()
if (xManager.is())
{
const basegfx::B2DRange aRange = vcl::unotools::b2DRectangleFromRectangle(maRectangle);
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHilightColor(aSvtOptionsDrawinglayer.getHilightColor());
- const double fTransparence(aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() * 0.01);
+ const Color aHilightColor(SvtOptionsDrawinglayer::getHilightColor());
+ const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01);
// make animation dependent from text edit active, because for tables
// this handle is also used when text edit *is* active for it. This
// interferes too much concerning repaint stuff (at least as long as
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 8785b910a0e6..a7c392a194d2 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -63,6 +63,7 @@
#include <svx/svdoutl.hxx>
#include <svx/xlineit0.hxx>
#include <editeng/flditem.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include "UnoGraphicExporter.hxx"
#include <memory>
@@ -1010,15 +1011,14 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
ErrCode nStatus = ERRCODE_NONE;
if (maGraphic.IsNone())
{
- SvtOptionsDrawinglayer aOptions;
- bool bAntiAliasing = aOptions.IsAntiAliasing();
+ bool bAntiAliasing = SvtOptionsDrawinglayer::IsAntiAliasing();
AllSettings aAllSettings = Application::GetSettings();
StyleSettings aStyleSettings = aAllSettings.GetStyleSettings();
bool bUseFontAAFromSystem = aStyleSettings.GetUseFontAAFromSystem();
if (aSettings.meAntiAliasing != TRISTATE_INDET)
{
// This is safe to do globally as we own the solar mutex.
- aOptions.SetAntiAliasing(aSettings.meAntiAliasing == TRISTATE_TRUE);
+ SvtOptionsDrawinglayer::SetAntiAliasing(aSettings.meAntiAliasing == TRISTATE_TRUE, /*bTemporary*/true);
// Opt in to have AA affect font rendering as well.
aStyleSettings.SetUseFontAAFromSystem(false);
aAllSettings.SetStyleSettings(aStyleSettings);
@@ -1027,7 +1027,7 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? ERRCODE_NONE : ERRCODE_GRFILTER_FILTERERROR;
if (aSettings.meAntiAliasing != TRISTATE_INDET)
{
- aOptions.SetAntiAliasing(bAntiAliasing);
+ SvtOptionsDrawinglayer::SetAntiAliasing(bAntiAliasing, /*bTemporary*/true);
aStyleSettings.SetUseFontAAFromSystem(bUseFontAAFromSystem);
aAllSettings.SetStyleSettings(aStyleSettings);
Application::SetSettings(aAllSettings);
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 59c1848fc539..1bc01a2b3d14 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -56,7 +56,7 @@
#include <PostItMgr.hxx>
#include <SwGrammarMarkUp.hxx>
#include <docsh.hxx>
-
+#include <svtools/optionsdrawinglayer.hxx>
#include <cellfrm.hxx>
#include <wrtsh.hxx>
@@ -429,8 +429,7 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
if (xTargetOverlay.is())
{
// get the system's highlight color
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+ const Color aHighlight(SvtOptionsDrawinglayer::getHilightColor());
// create correct selection
m_pCursorOverlay.reset( new sdr::overlay::OverlaySelection(
@@ -539,8 +538,7 @@ void SwSelPaintRects::HighlightInputField()
if (xTargetOverlay.is())
{
// use system's highlight color with decreased luminance as highlight color
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- Color aHighlight(aSvtOptionsDrawinglayer.getHilightColor());
+ Color aHighlight(SvtOptionsDrawinglayer::getHilightColor());
aHighlight.DecreaseLuminance( 128 );
m_pTextInputFieldOverlay.reset( new sw::overlay::OverlayRangesOutline(
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 274af330fe13..2d19c61972f9 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -1149,7 +1149,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr
{
// Fix for bug fdo#33781
const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
- if (pShell->Imp()->GetDrawView()->IsAntiAliasing())
+ if (SwDrawView::IsAntiAliasing())
{
pOut->SetAntialiasing( nFormerAntialiasingAtOutput | AntialiasingFlags::Enable );
}
@@ -1328,14 +1328,14 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr
}
}
- if ( pShell->Imp()->GetDrawView()->IsAntiAliasing() )
+ if ( SwDrawView::IsAntiAliasing() )
pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
}
else // bIsChart || pOLENd
{
// Fix for bug fdo#33781
const AntialiasingFlags nFormerAntialiasingAtOutput( pOut->GetAntialiasing() );
- if (pShell->Imp()->GetDrawView()->IsAntiAliasing())
+ if (SwDrawView::IsAntiAliasing())
{
AntialiasingFlags nNewAntialiasingAtOutput = nFormerAntialiasingAtOutput | AntialiasingFlags::Enable;
@@ -1414,7 +1414,7 @@ void SwNoTextFrame::PaintPicture( vcl::RenderContext* pOut, const SwRect &rGrfAr
}
// see #i99665#
- if (pShell->Imp()->GetDrawView()->IsAntiAliasing())
+ if (SwDrawView::IsAntiAliasing())
{
pOut->SetAntialiasing( nFormerAntialiasingAtOutput );
}
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index b2ad0f39c14e..276fbf922c9a 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -18,6 +18,7 @@
*/
#include <hintids.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
#include <svx/fmmodel.hxx>
@@ -118,16 +119,16 @@ SwDrawView::SwDrawView(
SetPrintPreview( rI.GetShell()->IsPreview() );
// #i73602# Use default from the configuration
- SetBufferedOverlayAllowed(getOptionsDrawinglayer().IsOverlayBuffer_Writer());
+ SetBufferedOverlayAllowed(SvtOptionsDrawinglayer::IsOverlayBuffer_Writer());
// #i74769#, #i75172# Use default from the configuration
- SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_Writer());
+ SetBufferedOutputAllowed(SvtOptionsDrawinglayer::IsPaintBuffer_Writer());
}
// #i99665#
-bool SwDrawView::IsAntiAliasing() const
+bool SwDrawView::IsAntiAliasing()
{
- return getOptionsDrawinglayer().IsAntiAliasing();
+ return SvtOptionsDrawinglayer::IsAntiAliasing();
}
static SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt16 nTol, const SdrMarkList &rMrkList)
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index 6b6910d0e77a..3e9f4e6c9864 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -110,7 +110,7 @@ public:
void ValidateMarkList() { FlushComeBackTimer(); }
// #i99665#
- bool IsAntiAliasing() const;
+ static bool IsAntiAliasing();
// method to replace marked/selected <SwDrawVirtObj>
// by its reference object for delete of selection and group selection
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 0155ceb08a30..0cf9c7fc7b26 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -115,6 +115,7 @@
#include <vcl/BitmapTools.hxx>
#include <comphelper/lok.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
#define COL_NOTES_SIDEPANE Color(230,230,230)
#define COL_NOTES_SIDEPANE_BORDER Color(200,200,200)
@@ -1735,13 +1736,11 @@ bool DrawFillAttributes(
!basegfx::fTools::equalZero(aPaintRange.getWidth()) &&
!basegfx::fTools::equalZero(aPaintRange.getHeight()))
{
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
-
// need to expand for correct AAed and non-AAed visualization as primitive.
// This must probably be removed again when we will be able to get all Writer visualization
// as primitives and Writer prepares all it's stuff in high precision coordinates (also
// needs to avoid moving boundaries around to better show overlapping stuff...)
- if(aSvtOptionsDrawinglayer.IsAntiAliasing())
+ if(SvtOptionsDrawinglayer::IsAntiAliasing())
{
// if AAed in principle expand by 0.5 in all directions. Since painting edges of
// AAed regions does not add to no transparence (0.5 opacity covered by 0.5 opacity
diff --git a/sw/source/uibase/docvw/OverlayRanges.cxx b/sw/source/uibase/docvw/OverlayRanges.cxx
index e00aaa30c3e6..99bdbdbc5c91 100644
--- a/sw/source/uibase/docvw/OverlayRanges.cxx
+++ b/sw/source/uibase/docvw/OverlayRanges.cxx
@@ -29,6 +29,7 @@
#include <drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx>
#include <drawinglayer/primitive2d/PolyPolygonHairlinePrimitive2D.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <svtools/optionsdrawinglayer.hxx>
namespace
{
@@ -73,8 +74,7 @@ namespace sw::overlay
aRGBColor));
}
// embed all rectangles in transparent paint
- const SvtOptionsDrawinglayer aSvtOptionsDrawinglayer;
- const sal_uInt16 nTransparence( aSvtOptionsDrawinglayer.GetTransparentSelectionPercent() );
+ const sal_uInt16 nTransparence( SvtOptionsDrawinglayer::GetTransparentSelectionPercent() );
const double fTransparence( nTransparence / 100.0 );
const drawinglayer::primitive2d::Primitive2DReference aUnifiedTransparence(
new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 61cded7dc56f..fc83f57a03f1 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -133,9 +133,8 @@ void PageFormatPanel::Initialize()
SetMarginFieldUnit();
aCustomEntry = mxCustomEntry->get_label();
- const SvtOptionsDrawinglayer aDrawinglayerOpt;
- mxPaperWidth->set_max(mxPaperWidth->normalize(aDrawinglayerOpt.GetMaximumPaperWidth()), FieldUnit::CM);
- mxPaperHeight->set_max(mxPaperHeight->normalize(aDrawinglayerOpt.GetMaximumPaperHeight()), FieldUnit::CM);
+ mxPaperWidth->set_max(mxPaperWidth->normalize(SvtOptionsDrawinglayer::GetMaximumPaperWidth()), FieldUnit::CM);
+ mxPaperHeight->set_max(mxPaperHeight->normalize(SvtOptionsDrawinglayer::GetMaximumPaperHeight()), FieldUnit::CM);
mxPaperSizeBox->connect_changed( LINK(this, PageFormatPanel, PaperFormatModifyHdl ));
mxPaperOrientation->connect_changed( LINK(this, PageFormatPanel, PaperFormatModifyHdl ));