summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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>
Diffstat (limited to 'sw')
-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
7 files changed, 19 insertions, 22 deletions
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 ));