summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-11-30 15:06:04 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-11-30 15:47:59 +0100
commit77eec4c6c77f64eb257e0e7a5ff721f23886b883 (patch)
tree90c1579716825a2530bf0c9c5b825e6b59e51515
parentd0e040698de6a88793f4ddd3b257a3dde0644b2f (diff)
Replace uses of boost::optional<>::get_ptr with free function
...in preparation of replacing boost::optional with std::optional, which doesn't have get_ptr Change-Id: I432d6deb7cf9b892b6126245882c74ab680f2984 Reviewed-on: https://gerrit.libreoffice.org/84119 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--sw/source/core/layout/paintfrm.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a7508171ecad..21c64087a460 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4764,6 +4764,14 @@ namespace drawinglayer
} // end of namespace primitive2d
} // end of namespace drawinglayer
+namespace {
+
+editeng::SvxBorderLine const * get_ptr(boost::optional<editeng::SvxBorderLine> const & opt) {
+ return opt ? &*opt : nullptr;
+}
+
+}
+
void PaintCharacterBorder(
const SwFont& rFont,
const SwRect& rPaintArea,
@@ -4818,17 +4826,17 @@ void PaintCharacterBorder(
aAlignedRect.Width(), aAlignedRect.Height(),
aAlignedRect.Left(), aAlignedRect.Top()));
const svx::frame::Style aStyleTop(
- bTop ? rFont.GetAbsTopBorder(bVerticalLayout, bVerticalLayoutLRBT).get_ptr() : nullptr,
+ bTop ? get_ptr(rFont.GetAbsTopBorder(bVerticalLayout, bVerticalLayoutLRBT)) : nullptr,
1.0);
const svx::frame::Style aStyleRight(
- bRight ? rFont.GetAbsRightBorder(bVerticalLayout, bVerticalLayoutLRBT).get_ptr() : nullptr,
+ bRight ? get_ptr(rFont.GetAbsRightBorder(bVerticalLayout, bVerticalLayoutLRBT)) : nullptr,
1.0);
const svx::frame::Style aStyleBottom(
- bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout, bVerticalLayoutLRBT).get_ptr()
+ bBottom ? get_ptr(rFont.GetAbsBottomBorder(bVerticalLayout, bVerticalLayoutLRBT))
: nullptr,
1.0);
const svx::frame::Style aStyleLeft(
- bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout, bVerticalLayoutLRBT).get_ptr() : nullptr,
+ bLeft ? get_ptr(rFont.GetAbsLeftBorder(bVerticalLayout, bVerticalLayoutLRBT)) : nullptr,
1.0);
drawinglayer::primitive2d::Primitive2DContainer aBorderLineTarget;