Kaydet (Commit) cf3c6cb4 authored tarafından Chris Sherlock's avatar Chris Sherlock

VCL: ImpObjStack replaced with std::stack

ImpObjStack uses it's own home-grown stack and stack functions. There
is a function that unwinds the stack, but really it would be better if
we used std::set. In fact, this is better, because the name ImpObjStack
is really not terribly descriptive. I've replaced it with a stack of
OutDevState objects.

Change-Id: I87bdd4340ad77b7ffd9ff176fa5a9ffeac8b8666
üst ef3b6888
......@@ -34,6 +34,8 @@
#include <vcl/metaact.hxx>
#include <vcl/salnativewidgets.hxx>
#include <vcl/outdevstate.hxx>
#include <basegfx/vector/b2enums.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
......@@ -45,6 +47,7 @@
#include <com/sun/star/uno/Reference.h>
#include <vector>
#include <stack>
#if defined UNX
#define GLYPH_FONT_HEIGHT 128
......@@ -57,7 +60,7 @@
struct ImplOutDevData;
class ImplFontEntry;
struct ImplObjStack;
class OutDevState;
struct SystemGraphicsData;
struct SystemFontData;
struct SystemTextLayoutData;
......@@ -141,25 +144,6 @@ struct ImplThresholdRes
// OutputDevice-Types
// Flags for Push()
#define PUSH_LINECOLOR ((sal_uInt16)0x0001)
#define PUSH_FILLCOLOR ((sal_uInt16)0x0002)
#define PUSH_FONT ((sal_uInt16)0x0004)
#define PUSH_TEXTCOLOR ((sal_uInt16)0x0008)
#define PUSH_MAPMODE ((sal_uInt16)0x0010)
#define PUSH_CLIPREGION ((sal_uInt16)0x0020)
#define PUSH_RASTEROP ((sal_uInt16)0x0040)
#define PUSH_TEXTFILLCOLOR ((sal_uInt16)0x0080)
#define PUSH_TEXTALIGN ((sal_uInt16)0x0100)
#define PUSH_REFPOINT ((sal_uInt16)0x0200)
#define PUSH_TEXTLINECOLOR ((sal_uInt16)0x0400)
#define PUSH_TEXTLAYOUTMODE ((sal_uInt16)0x0800)
#define PUSH_TEXTLANGUAGE ((sal_uInt16)0x1000)
#define PUSH_OVERLINECOLOR ((sal_uInt16)0x2000)
#define PUSH_ALLTEXT (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
#define PUSH_ALLFONT (PUSH_ALLTEXT | PUSH_FONT)
#define PUSH_ALL ((sal_uInt16)0xFFFF)
// Flags for DrawText()
#define TEXT_DRAW_DISABLE ((sal_uInt16)0x0001)
#define TEXT_DRAW_MNEMONIC ((sal_uInt16)0x0002)
......@@ -300,7 +284,7 @@ private:
mutable PhysicalFontCollection* mpFontCollection;
mutable ImplGetDevFontList* mpGetDevFontList;
mutable ImplGetDevSizeList* mpGetDevSizeList;
ImplObjStack* mpObjStack;
std::stack < OutDevState* >* mpOutDevStateStack;
ImplOutDevData* mpOutDevData;
VCLXGraphicsList_impl* mpUnoGraphicsList;
vcl::PDFWriterImpl* mpPDFWriter;
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_VCL_INC_OUTDEVSTATE_HXX
#define INCLUDED_VCL_INC_OUTDEVSTATE_HXX
#include <sal/types.h>
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
#include <vcl/font.hxx>
#include <vcl/vclenum.hxx>
#include <tools/gen.hxx>
#include <tools/color.hxx>
#include <tools/fontenum.hxx>
// Flags for OutputDevice::Push() and OutDevState
#define PUSH_LINECOLOR ((sal_uInt16)0x0001)
#define PUSH_FILLCOLOR ((sal_uInt16)0x0002)
#define PUSH_FONT ((sal_uInt16)0x0004)
#define PUSH_TEXTCOLOR ((sal_uInt16)0x0008)
#define PUSH_MAPMODE ((sal_uInt16)0x0010)
#define PUSH_CLIPREGION ((sal_uInt16)0x0020)
#define PUSH_RASTEROP ((sal_uInt16)0x0040)
#define PUSH_TEXTFILLCOLOR ((sal_uInt16)0x0080)
#define PUSH_TEXTALIGN ((sal_uInt16)0x0100)
#define PUSH_REFPOINT ((sal_uInt16)0x0200)
#define PUSH_TEXTLINECOLOR ((sal_uInt16)0x0400)
#define PUSH_TEXTLAYOUTMODE ((sal_uInt16)0x0800)
#define PUSH_TEXTLANGUAGE ((sal_uInt16)0x1000)
#define PUSH_OVERLINECOLOR ((sal_uInt16)0x2000)
#define PUSH_ALLTEXT (PUSH_TEXTCOLOR | PUSH_TEXTFILLCOLOR | PUSH_TEXTLINECOLOR | PUSH_OVERLINECOLOR | PUSH_TEXTALIGN | PUSH_TEXTLAYOUTMODE | PUSH_TEXTLANGUAGE)
#define PUSH_ALLFONT (PUSH_ALLTEXT | PUSH_FONT)
#define PUSH_ALL ((sal_uInt16)0xFFFF)
class OutDevState
{
public:
~OutDevState();
MapMode* mpMapMode;
bool mbMapActive;
Region* mpClipRegion;
Color* mpLineColor;
Color* mpFillColor;
Font* mpFont;
Color* mpTextColor;
Color* mpTextFillColor;
Color* mpTextLineColor;
Color* mpOverlineColor;
Point* mpRefPoint;
TextAlign meTextAlign;
RasterOp meRasterOp;
sal_uLong mnTextLayoutMode;
LanguageType meTextLanguage;
sal_uInt16 mnFlags;
};
#endif // INCLUDED_VCL_INC_OUTDEVSTATE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -235,6 +235,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/gdi/octree \
vcl/source/gdi/oldprintadaptor \
vcl/source/outdev/outdev \
vcl/source/outdev/outdevstate \
vcl/source/outdev/clipping \
vcl/source/outdev/polygon \
vcl/source/outdev/transparent \
......
......@@ -33,13 +33,13 @@
#include <vcl/IconThemeScanner.hxx>
#include <vcl/IconThemeSelector.hxx>
#include <vcl/IconThemeInfo.hxx>
#include "vcl/svapp.hxx"
#include "vcl/event.hxx"
#include "vcl/settings.hxx"
#include "vcl/i18nhelp.hxx"
#include "vcl/configsettings.hxx"
#include "vcl/gradient.hxx"
#include "vcl/outdev.hxx"
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
#include <vcl/settings.hxx>
#include <vcl/i18nhelp.hxx>
#include <vcl/configsettings.hxx>
#include <vcl/gradient.hxx>
#include <vcl/outdev.hxx>
#include "unotools/fontcfg.hxx"
#include "unotools/localedatawrapper.hxx"
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/types.h>
#include <vcl/mapmod.hxx>
#include <vcl/region.hxx>
#include <vcl/font.hxx>
#include <vcl/vclenum.hxx>
#include <tools/gen.hxx>
#include <tools/color.hxx>
#include <tools/fontenum.hxx>
#include <vcl/outdevstate.hxx>
#include "sallayout.hxx"
OutDevState::~OutDevState()
{
if ( mnFlags & PUSH_LINECOLOR )
{
if ( mpLineColor )
delete mpLineColor;
}
if ( mnFlags & PUSH_FILLCOLOR )
{
if ( mpFillColor )
delete mpFillColor;
}
if ( mnFlags & PUSH_FONT )
delete mpFont;
if ( mnFlags & PUSH_TEXTCOLOR )
delete mpTextColor;
if ( mnFlags & PUSH_TEXTFILLCOLOR )
{
if ( mpTextFillColor )
delete mpTextFillColor;
}
if ( mnFlags & PUSH_TEXTLINECOLOR )
{
if ( mpTextLineColor )
delete mpTextLineColor;
}
if ( mnFlags & PUSH_OVERLINECOLOR )
{
if ( mpOverlineColor )
delete mpOverlineColor;
}
if ( mnFlags & PUSH_MAPMODE )
{
if ( mpMapMode )
delete mpMapMode;
}
if ( mnFlags & PUSH_CLIPREGION )
{
if ( mpClipRegion )
delete mpClipRegion;
}
if ( mnFlags & PUSH_REFPOINT )
{
if ( mpRefPoint )
delete mpRefPoint;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment