summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-23 14:01:24 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-24 14:42:26 +0200
commit6217cfd414ee86b160313c0a71b7d62e1eb3db14 (patch)
tree1471e49de2c68a0cc4d0f42bfb37dc8bffb883bf /editeng
parenta27d9845935149005342c74736a961068e6bf242 (diff)
Introduce OutputDevice type OUTDEV_PDF
Originally I thought mpPDFWriter can be used to create PDF from any OutputDevice, but it's actually just set for the internal VirtualDevice of the PDF writer. So this gets rid of all the special mpPDFWriter and GetPDFWriter() handling and replaces it with checks for OUTDEV_PDF. But since ImplPDFWriter used to be a OUTDEV_VIRDEV, this also introduces OutputDevice::IsVirtual(), which now replaces most of the direct OUTDEV_VIRDEV checks. Change-Id: I11824143b6b8833ecc81119762448cbdf1145dbc Reviewed-on: https://gerrit.libreoffice.org/62257 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editobj2.hxx3
-rw-r--r--editeng/source/editeng/impedit3.cxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx5
3 files changed, 5 insertions, 5 deletions
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index 7da37fc2f31d..9ec7bb698108 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -112,10 +112,11 @@ public:
OutputDevice* GetRefDevPtr() const { return nRefDevPtr; }
sal_uLong GetPaperWidth() const { return nPaperWidth; }
OutDevType GetRefDevType() const { return eRefDevType; }
+ bool RefDevIsVirtual() const
+ { return (eRefDevType == OUTDEV_VIRDEV) || (eRefDevType == OUTDEV_PDF); }
const MapMode& GetRefMapMode() const { return aRefMapMode; }
sal_uInt16 GetStretchX() const { return nStretchX; }
sal_uInt16 GetStretchY() const { return nStretchY; }
-
};
class ContentInfo
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index c4938eb3f075..14e2510024aa 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2831,7 +2831,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo
{
// #i75566# Do not use AutoColor when printing OR Pdf export
const bool bPrinting(OUTDEV_PRINTER == pOut->GetOutDevType());
- const bool bPDFExporting(nullptr != pOut->GetPDFWriter());
+ const bool bPDFExporting(OUTDEV_PDF == pOut->GetOutDevType());
if ( IsAutoColorEnabled() && !bPrinting && !bPDFExporting)
{
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 64bc7443014e..4be47ec63d4a 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1178,9 +1178,8 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject
&& ( pPortionInfo->GetStretchX() == nStretchX )
&& ( pPortionInfo->GetStretchY() == nStretchY ) )
{
- if ( ( pPortionInfo->GetRefDevPtr() == GetRefDevice() ) ||
- ( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) &&
- ( GetRefDevice()->GetOutDevType() == OUTDEV_VIRDEV ) ) )
+ if ( (pPortionInfo->GetRefDevPtr() == GetRefDevice()) ||
+ (pPortionInfo->RefDevIsVirtual() && GetRefDevice()->IsVirtual()) )
bUsePortionInfo = true;
}