[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - basegfx/Library_basegfx.mk basegfx/source chart2/source cui/source cui/uiconfig drawinglayer/source editeng/source include/basegfx include/drawinglayer include/editeng include/svx include/xmloff officecfg/registry reportdesign/source sc/source sd/source sfx2/source svl/source svx/source sw/inc sw/Library_sw.mk sw/sdi sw/source sw/uiconfig vcl/source writerfilter/source xmloff/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Jul 4 09:45:32 PDT 2014
basegfx/Library_basegfx.mk | 1
basegfx/source/numeric/ftools.cxx | 49
chart2/source/controller/main/ShapeController.cxx | 3
cui/source/factory/dlgfact.cxx | 4
cui/source/factory/dlgfact.hxx | 2
cui/source/inc/backgrnd.hxx | 16
cui/source/inc/cuires.hrc | 1
cui/source/inc/cuitabarea.hxx | 29
cui/source/tabpages/backgrnd.cxx | 177 +-
cui/source/tabpages/strings.src | 4
cui/source/tabpages/tabarea.cxx | 13
cui/source/tabpages/tparea.cxx | 250 +--
cui/uiconfig/ui/areatabpage.ui | 13
drawinglayer/source/attribute/sdrfillgraphicattribute.cxx | 17
drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx | 117 -
drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx | 48
drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx | 118 -
drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx | 21
drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 65
drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 2
drawinglayer/source/processor3d/defaultprocessor3d.cxx | 63
drawinglayer/source/texture/texture.cxx | 230 --
drawinglayer/source/texture/texture3d.cxx | 18
editeng/source/items/frmitems.cxx | 18
include/basegfx/numeric/ftools.hxx | 10
include/drawinglayer/primitive2d/fillgradientprimitive2d.hxx | 25
include/drawinglayer/primitive2d/fillhatchprimitive2d.hxx | 20
include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx | 33
include/drawinglayer/texture/texture.hxx | 52
include/editeng/brushitem.hxx | 5
include/editeng/unoprnms.hxx | 7
include/svx/sdr/primitive2d/sdrattributecreator.hxx | 4
include/svx/sdr/primitive2d/sdrdecompositiontools.hxx | 21
include/svx/svxdlg.hxx | 2
include/svx/svxids.hrc | 68
include/svx/unoshprp.hxx | 26
include/svx/xfillit0.hxx | 1
include/svx/xgrad.hxx | 1
include/xmloff/XMLShapeStyleContext.hxx | 2
include/xmloff/txtprmap.hxx | 8
include/xmloff/xmltypes.hxx | 10
officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu | 4
reportdesign/source/ui/misc/UITools.cxx | 2
sc/source/ui/drawfunc/drawsh.cxx | 2
sd/source/ui/func/fuarea.cxx | 2
sfx2/source/dialog/tabdlg.cxx | 16
svl/source/undo/undo.cxx | 4
svx/source/dialog/dlgctrl.cxx | 2
svx/source/sdr/contact/viewcontactofmasterpagedescriptor.cxx | 2
svx/source/sdr/contact/viewcontactofsdrcaptionobj.cxx | 1
svx/source/sdr/contact/viewcontactofsdrpage.cxx | 2
svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx | 17
svx/source/sdr/primitive2d/sdrconnectorprimitive2d.cxx | 1
svx/source/sdr/primitive2d/sdrdecompositiontools.cxx | 63
svx/source/sdr/primitive2d/sdrellipseprimitive2d.cxx | 24
svx/source/sdr/primitive2d/sdrgrafprimitive2d.cxx | 13
svx/source/sdr/primitive2d/sdrmeasureprimitive2d.cxx | 8
svx/source/sdr/primitive2d/sdrole2primitive2d.cxx | 14
svx/source/sdr/primitive2d/sdrpathprimitive2d.cxx | 12
svx/source/sdr/primitive2d/sdrrectangleprimitive2d.cxx | 12
svx/source/svdraw/svddrgmt.cxx | 1
svx/source/table/viewcontactoftableobj.cxx | 6
svx/source/xoutdev/xattr.cxx | 21
sw/Library_sw.mk | 2
sw/inc/doc.hxx | 7
sw/inc/fillattributes.hxx | 70
sw/inc/format.hxx | 38
sw/inc/frmatr.hxx | 8
sw/inc/frmfmt.hxx | 32
sw/inc/hintids.hxx | 18
sw/inc/swatrset.hxx | 8
sw/inc/unobrushitemhelper.hxx | 36
sw/inc/unoframe.hxx | 5
sw/inc/unomap.hxx | 8
sw/inc/unoprnms.hxx | 31
sw/sdi/_frmsh.sdi | 95 -
sw/source/core/access/accpara.cxx | 8
sw/source/core/attr/format.cxx | 193 --
sw/source/core/attr/swatrset.cxx | 87 -
sw/source/core/bastyp/init.cxx | 12
sw/source/core/doc/docdraw.cxx | 74
sw/source/core/doc/docfly.cxx | 71
sw/source/core/doc/notxtfrm.cxx | 21
sw/source/core/doc/poolfmt.cxx | 4
sw/source/core/draw/dflyobj.cxx | 1
sw/source/core/inc/dflyobj.hxx | 1
sw/source/core/inc/frame.hxx | 14
sw/source/core/inc/frmtool.hxx | 15
sw/source/core/layout/atrfrm.cxx | 127 -
sw/source/core/layout/fillattributes.cxx | 141 -
sw/source/core/layout/paintfrm.cxx | 632 +++-----
sw/source/core/layout/wsfrm.cxx | 8
sw/source/core/text/inftxt.cxx | 20
sw/source/core/text/porfld.cxx | 4
sw/source/core/text/txtfly.cxx | 14
sw/source/core/txtnode/fntcache.cxx | 7
sw/source/core/uibase/app/docst.cxx | 27
sw/source/core/uibase/app/docstyle.cxx | 70
sw/source/core/uibase/frmdlg/frmmgr.cxx | 5
sw/source/core/uibase/inc/frmdlg.hxx | 4
sw/source/core/uibase/inc/frmsh.hxx | 8
sw/source/core/uibase/inc/tmpdlg.hxx | 2
sw/source/core/uibase/shells/basesh.cxx | 89 -
sw/source/core/uibase/shells/drawdlg.cxx | 2
sw/source/core/uibase/shells/frmsh.cxx | 209 --
sw/source/core/uibase/shells/grfsh.cxx | 57
sw/source/core/unocore/unobrushitemhelper.cxx | 327 ----
sw/source/core/unocore/unoframe.cxx | 848 +----------
sw/source/core/unocore/unomap.cxx | 94 -
sw/source/core/unocore/unostyle.cxx | 395 -----
sw/source/filter/html/css1atr.cxx | 2
sw/source/filter/html/htmlatr.cxx | 2
sw/source/filter/ww8/docxattributeoutput.cxx | 6
sw/source/filter/ww8/ww8atr.cxx | 32
sw/source/ui/fmtui/tmpdlg.cxx | 40
sw/source/ui/frmdlg/frmdlg.cxx | 67
sw/uiconfig/swriter/ui/framedialog.ui | 22
sw/uiconfig/swriter/ui/templatedialog4.ui | 24
vcl/source/gdi/impgraph.cxx | 22
writerfilter/source/dmapper/TablePositionHandler.cxx | 4
xmloff/source/draw/XMLShapeStyleContext.cxx | 81 -
xmloff/source/draw/sdpropls.cxx | 6
xmloff/source/text/txtexppr.cxx | 38
xmloff/source/text/txtprhdl.cxx | 49
xmloff/source/text/txtprmap.cxx | 29
125 files changed, 1327 insertions(+), 4849 deletions(-)
New commits:
commit dc17dad5fd7509f191718df8690e5847ab87669a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jul 3 16:10:40 2014 +0200
fdo#78908 Revert "Merge back branch alg_writerframes to trunk"
This reverts commit 6e61ecd09679a66060f932835622821d39e92f01. Better not
to have this on libreoffice-4-3 without
7d9bb549d498d6beed2c4050c402d09643febdfa (Related: #i124638# Second step
of DrawingLayer FillAttributes..., 2014-06-02).
Conflicts:
cui/source/inc/backgrnd.hxx
cui/source/inc/cuitabarea.hxx
cui/source/tabpages/backgrnd.cxx
cui/source/tabpages/tparea.cxx
include/basegfx/numeric/ftools.hxx
include/svx/svxids.hrc
include/svx/unoshprp.hxx
sc/source/ui/drawfunc/drawsh.cxx
sd/source/ui/func/fuarea.cxx
sfx2/source/dialog/tabdlg.cxx
sw/inc/fillattributes.hxx
sw/inc/format.hxx
sw/inc/frmatr.hxx
sw/inc/swatrset.hxx
sw/inc/unobrushitemhelper.hxx
sw/qa/extras/rtfexport/rtfexport.cxx
sw/source/core/attr/format.cxx
sw/source/core/attr/swatrset.cxx
sw/source/core/doc/docfly.cxx
sw/source/core/doc/notxtfrm.cxx
sw/source/core/inc/frame.hxx
sw/source/core/inc/frmtool.hxx
sw/source/core/layout/fillattributes.cxx
sw/source/core/layout/paintfrm.cxx
sw/source/core/txtnode/fntcache.cxx
sw/source/core/uibase/shells/frmsh.cxx
sw/source/core/unocore/unobrushitemhelper.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unostyle.cxx
xmloff/source/text/txtexppr.cxx
xmloff/source/text/txtprhdl.cxx
Also:
Revert "cppcheck: Prefer prefix ++/-- operators for non-primitive types"
This reverts commit 80ec4885e97b3fcb34b93e71ced52a4aab43ce93.
Revert "WaE: implicit conversion of literal of type 'sal_Bool' to 'bool'"
This reverts commit d5d10b03b1f3e4bf784ad35254cb55d719a8c1b3.
Revert "i#124638 support for DrawingLayre FillStyle for GraphicFrames and ..."
This reverts commit 4a0b5e569d070c286daefb0fdfe45c0dd15d241c.
Revert "svx: fix SID_OFFER_IMPORT and SID_ATTR_CHAR_GRABBAG having the same SID"
This reverts commit b66d87086804460c1986df1b832fd6b2ea075a90.
Revert "SwXStyle::getPropertyValue: don't try to read a float into a sal_Int32"
This reverts commit 1e3c7b854baac2502bed72ff8e3e1b21b507735b.
Revert "SwXTextFrame: also restore semi-lost BackColorTransparency property"
This reverts commit 102bb87ca1a5dee3a09442bf503a54bb703c79ea.
Revert "SwXTextFrame: restore semi-lost BackColor property"
This reverts commit 5ce92b73ce06c805c66e53c48aa2c70c722aaf60.
Revert "DocxAttributeOutput: port to FillAttributes"
This reverts commit ec221b7339f8fe5520926ef85b450daa94392780.
Revert "MSWordExportBase::OutputItemSet: handle fill attributes as frame ones"
This reverts commit 84c40768f8acb0342dcfa223133497f57620fc14.
Revert "sw: put getSvx* and setSvx* to a namespace, now that these are public"
This reverts commit ebf960960a69c1edb5da1994c330ddddbecac44d.
Revert "sw: fix DOC/DOCX/RTF export of TextFrame background color"
This reverts commit c7837b8caad61b8c0dfd3704a133cdeaffd69b06.
Revert "sw: still use SvxBrushItem for page style background"
This reverts commit e826950e9d7736a6e3f9042755ba1b528f58a505.
Revert "cui: unused code in SvxAreaTabPage::ClickBitmapHdl_Impl"
This reverts commit 2032e9f5d7683e49b8753d7c7362899c690005b6.
Revert "cui: unused code in SvxAreaTabPage::ClickGradientHdl_Impl"
This reverts commit f4fa202b31277276dc4f05046c82152c0830ef21.
Revert "cui: unused code in SvxAreaTabPage::ClickColorHdl_Impl"
This reverts commit 1478e89e08a54f02a137c74c0cde6ae75e80d9f3.
Revert "cui: unused code in SvxAreaTabPage::ClickHatchingHdl_Impl()"
This reverts commit e9c9f3f793a91525ac4fb74f8791ba74222515e4.
Revert "svx: fix Writer's insert -> frame crash"
This reverts commit 831b8751fc9f423fd4e459623e54801c0a020eb3.
Revert "sw: adapt frame/templatedialog4.ui to FillAttributes"
This reverts commit 55916fc50a5b2d6273bca8c9ef6253011cf4fdbc.
Revert "-Werror,-Wunused-variable"
This reverts commit d0542fe7251d9c6538331b22a4b5e2e294a92e97.
Revert "loplugin:implicitboolconversion,literaltoboolconversion"
This reverts commit 47862e75de51a4ac7476acff773b504fdc0d6e76.
Revert "loplugin:saloverride"
This reverts commit be89e8b8ac19c0feca8850ccaddd90205c63dbe5.
Revert "loplugin:literaltoboolconversion"
This reverts commit 355b31fe347479f63906e41300042ec5cb38837c.
Revert "-Werror,-Wunused-private-field"
This reverts commit df9d13dd2e754184a4c6e321b8910ee1bc0cafa1.
Revert "-Werror,-Wunused-const-variable"
This reverts commit d757a98001a65baf4066c2eda037a08ab1beda46.
Revert "unused XFillStyleItem ctor"
This reverts commit b735fe1d67e6ad7ad448e448f237dcabef1a1c38.
Revert "unused XGradient::VclGradient"
This reverts commit 5bbc90be755aae4b87125f9d748828d74efe645d.
Revert "fix "transparency" of floating tables in docx import (fdo#77723)"
This reverts commit 313b59d787357ef3da34e2833fefcf1143b09b5e.
Change-Id: If855b090f94288d384f8733f88ef1172e68c50a6
Reviewed-on: https://gerrit.libreoffice.org/10077
Tested-by: Michael Stahl <mstahl at redhat.com>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index ac5878a..134001b 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -39,7 +39,6 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
basegfx/source/matrix/b2dhommatrix \
basegfx/source/matrix/b2dhommatrixtools \
basegfx/source/matrix/b3dhommatrix \
- basegfx/source/numeric/ftools \
basegfx/source/pixel/bpixel \
basegfx/source/point/b2dpoint \
basegfx/source/point/b2ipoint \
diff --git a/basegfx/source/numeric/ftools.cxx b/basegfx/source/numeric/ftools.cxx
deleted file mode 100644
index a67bc56..0000000
--- a/basegfx/source/numeric/ftools.cxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- 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 <basegfx/numeric/ftools.hxx>
-#include <algorithm>
-
-namespace basegfx
-{
- double snapToNearestMultiple(double v, const double fStep)
- {
- if(fTools::equalZero(fStep))
- {
- // with a zero step, all snaps to 0.0
- return 0.0;
- }
- else
- {
- const double fHalfStep(fStep * 0.5);
- const double fChange(fHalfStep - fmod(v + fHalfStep, fStep));
-
- if(basegfx::fTools::equal(fabs(v), fabs(fChange)))
- {
- return 0.0;
- }
- else
- {
- return v + fChange;
- }
- }
- }
-} // end of namespace basegfx
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index dea2771..fe70d66 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -307,7 +307,8 @@ void ShapeController::executeDispatch_FormatArea()
if ( pFact )
{
::boost::scoped_ptr< AbstractSvxAreaTabDialog > pDlg(
- pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(), true ) );
+ pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(),
+ pDrawViewWrapper ) );
if ( pDlg.get() )
{
SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 01490ba..2c34cb8 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1515,9 +1515,9 @@ AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterMos
AbstractSvxAreaTabDialog* AbstractDialogFactory_Impl::CreateSvxAreaTabDialog( Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
- bool bShadow)
+ const SdrView* pSdrView )
{
- SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel, bShadow );
+ SvxAreaTabDialog* pDlg = new SvxAreaTabDialog( pParent, pAttr, pModel,pSdrView );
return new AbstractSvxAreaTabDialog_Impl( pDlg );
}
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 1cf6b4c..feaad78 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -660,7 +660,7 @@ public:
virtual AbstractSvxAreaTabDialog* CreateSvxAreaTabDialog( Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
- bool bShadow ) SAL_OVERRIDE;
+ const SdrView* pSdrView = NULL ) SAL_OVERRIDE;
virtual SfxAbstractTabDialog* CreateSvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
SdrModel* pModel,
const SdrObject* pObj = NULL,
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index 709e4ea..be1183f 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -32,6 +32,8 @@ struct SvxBackgroundTable_Impl;
struct SvxBackgroundPara_Impl;
struct SvxBackgroundPage_Impl;
class SvxBrushItem;
+class XFillStyleItem;
+class XFillGradientItem;
/** class SvxBackgroundTabPage --------------------------------------------
@@ -85,6 +87,17 @@ private:
MetricField* m_pColTransMF;
CheckBox* m_pBtnPreview;
+ // Gradient controls
+ VclFrame* m_pBackGroundGradientFrame;
+ GradientLB* m_pLbGradients;
+ SvxXRectPreview* m_pCtlPreview;
+
+ // Gradient data
+ XGradientListRef m_pGradientList;
+ SfxItemPool* m_pXPool;
+ XFillAttrSetItem m_aXFillAttr;
+ SfxItemSet& m_rXFillSet;
+
// Background Bitmap ----------------------------------
VclContainer* m_pBitmapContainer;
VclContainer* m_pFileFrame;
@@ -128,6 +141,8 @@ private:
void HideColorUI_Impl();
void ShowBitmapUI_Impl();
void HideBitmapUI_Impl();
+ void ShowGradientUI_Impl();
+ void HideGradientUI_Impl();
bool LoadLinkedGraphic_Impl();
void RaiseLoadError_Impl();
void SetGraphicPosition_Impl( SvxGraphicPosition ePos );
@@ -145,6 +160,7 @@ private:
DECL_LINK(BackgroundColorHdl_Impl, void *);
DECL_LINK( TblDestinationHdl_Impl, ListBox* );
DECL_LINK( ParaDestinationHdl_Impl, ListBox* );
+ DECL_LINK(ModifyGradientHdl_Impl, void *);
};
#endif // INCLUDED_CUI_SOURCE_INC_BACKGRND_HXX
diff --git a/cui/source/inc/cuires.hrc b/cui/source/inc/cuires.hrc
index e741b43..a427883 100644
--- a/cui/source/inc/cuires.hrc
+++ b/cui/source/inc/cuires.hrc
@@ -42,7 +42,6 @@
// used in "tabpages"
#define RID_SVXSTRARY_PAPERSIZE_STD (RID_SVX_START + 142)
#define RID_SVXSTRARY_PAPERSIZE_DRAW (RID_SVX_START + 143)
-#define RID_SVXSTR_READ_DATA_ERROR (RID_SVX_START + 230)
#define RID_SVXSTR_TABLE_PRESET_NONE (RID_SVX_START + 969)
#define RID_SVXSTR_TABLE_PRESET_ONLYOUTER (RID_SVX_START + 970)
#define RID_SVXSTR_TABLE_PRESET_OUTERHORI (RID_SVX_START + 971)
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 4358fc4..526759f 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -75,7 +75,10 @@ protected:
void SavePalettes();
public:
- SvxAreaTabDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel, bool bShadow );
+ SvxAreaTabDialog( Window* pParent,
+ const SfxItemSet* pAttr,
+ SdrModel* pModel,
+ const SdrView* pSdrView = NULL );
virtual ~SvxAreaTabDialog();
void SetNewColorList( XColorListRef pColTab )
@@ -111,8 +114,8 @@ class SvxTransparenceTabPage : public SvxTabPage
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
- sal_uInt16 nPageType;
- sal_uInt16 nDlgType;
+ sal_uInt16 nPageType;
+ sal_uInt16 nDlgType;
// main selection
RadioButton* m_pRbtTransOff;
@@ -235,13 +238,6 @@ private:
XHatchListRef pHatchingList;
XBitmapListRef pBitmapList;
- // Placeholders for pointer-based entries; these will be inited
- // to point to these so that the page is usable without that
- // SvxAreaTabDialog has to call the setter methods (e.g. SetColorChgd).
- // Without that the pages used in SvxAreaTabDialog are not usable
- ChangeType maFixed_ChangeType;
- bool maFixed_sal_Bool;
-
ChangeType* pnColorListState;
ChangeType* pnBitmapListState;
ChangeType* pnGradientListState;
@@ -260,13 +256,6 @@ private:
SfxMapUnit ePoolUnit;
FieldUnit eFUnit;
- //UUUU
- bool mbOfferImportButton;
- bool mbDirectGraphicSet;
- Graphic maDirectGraphic;
- OUString maDirectName;
- PushButton* m_pBtnImport;
-
DECL_LINK(SelectDialogTypeHdl_Impl, void *);
DECL_LINK( ModifyColorHdl_Impl, void * );
DECL_LINK( ModifyHatchBckgrdColorHdl_Impl, void * );
@@ -275,10 +264,6 @@ private:
DECL_LINK( ToggleHatchBckgrdColorHdl_Impl, void * );
DECL_LINK( ModifyBitmapHdl_Impl, void * );
DECL_LINK( ModifyStepCountHdl_Impl, void * );
-
- //UUUU
- DECL_LINK( ClickImportHdl_Impl, void * );
-
DECL_LINK( ModifyTileHdl_Impl, void * );
DECL_LINK( ClickScaleHdl_Impl, void * );
void ClickInvisibleHdl_Impl();
@@ -288,7 +273,7 @@ private:
void ClickBitmapHdl_Impl();
public:
- SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs );
+ SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs );
void Construct();
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 374f79d..4d58aef 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -51,6 +51,8 @@
#include <sfx2/htmlmode.hxx>
#include <svtools/controldims.hrc>
#include <svx/flagsdef.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflgrit.hxx>
#include <svl/intitem.hxx>
#include <sfx2/request.hxx>
#include <svtools/grfmgr.hxx>
@@ -350,6 +352,9 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt )
SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rCoreSet)
: SvxTabPage(pParent, "BackgroundPage", "cui/ui/backgroundpage.ui", rCoreSet)
+ , m_pXPool(rCoreSet.GetPool())
+ , m_aXFillAttr(m_pXPool)
+ , m_rXFillSet(m_aXFillAttr.GetItemSet())
, nHtmlMode(0)
, bAllowShowSelector(true)
, bIsGraphicValid(false)
@@ -376,6 +381,17 @@ SvxBackgroundTabPage::SvxBackgroundTabPage(Window* pParent, const SfxItemSet& rC
get(m_pColTransMF, "transparencymf");
get(m_pBtnPreview, "showpreview");
+ // Initialize gradient controls
+ get(m_pBackGroundGradientFrame, "backgroundgradientframe");
+ get(m_pLbGradients, "gradientslb");
+ Size aSize = getDrawListBoxOptimalSize(this);
+ m_pLbGradients->set_width_request(aSize.Width());
+ m_pLbGradients->set_height_request(aSize.Height());
+ get(m_pCtlPreview, "previewctl");
+ aSize = getDrawPreviewOptimalSize(this);
+ m_pCtlPreview->set_width_request(aSize.Width());
+ m_pCtlPreview->set_height_request(aSize.Height());
+
get(m_pBitmapContainer, "graphicgrid");
get(m_pFileFrame, "fileframe");
get(m_pBtnBrowse, "browse");
@@ -774,6 +790,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
const SvxBrushItem& rOldItem = (const SvxBrushItem&)*pOld;
SvxGraphicPosition eOldPos = rOldItem.GetGraphicPos();
const bool bIsBrush = ( XFILL_SOLID == lcl_getFillStyle(m_pLbSelect) );
+ const bool bIsGradient = ( XFILL_GRADIENT == lcl_getFillStyle(m_pLbSelect) );
// transparency has to be set if enabled, the color not already set to "No fill" and
if( bColTransparency &&
@@ -781,22 +798,37 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
{
aBgdColor.SetTransparency(lcl_PercentToTransparency(static_cast<long>(m_pColTransMF->GetValue())));
}
- if ( ( (GPOS_NONE == eOldPos) && bIsBrush )
- || ( (GPOS_NONE != eOldPos) && !bIsBrush ) ) // Brush <-> Bitmap changed?
+ if ( ( (GPOS_NONE == eOldPos) && (bIsBrush || bIsGradient) )
+ || ( (GPOS_NONE != eOldPos) && !(bIsBrush || bIsGradient) ) ) // Brush <-> Bitmap changed?
{
// background art hasn't been changed:
if ( (GPOS_NONE == eOldPos) || !m_pLbSelect->IsVisible() )
{
- // Brush-treatment:
- if ( rOldItem.GetColor() != aBgdColor ||
- (SFX_ITEM_AVAILABLE >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection()))
+ if (bIsBrush)
{
- bModified = true;
- rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
+ // Brush-treatment:
+ if ( rOldItem.GetColor() != aBgdColor ||
+ (SFX_ITEM_AVAILABLE >= eOldItemState && !m_pBackgroundColorSet->IsNoSelection()))
+ {
+ bModified = true;
+ rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
+ }
+ else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+ rCoreSet.ClearItem( nWhich );
+ // Handle XFILL_GRADIENT -> XFILL_SOLID
+ XFillStyleItem aFillStyleItem(XFILL_SOLID, GetWhich(SID_SW_ATTR_FILL_STYLE));
+ rCoreSet.Put(aFillStyleItem);
+ }
+ else
+ {
+ XFillStyleItem aFillStyleItem(((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue(), GetWhich(SID_SW_ATTR_FILL_STYLE));
+ rCoreSet.Put(aFillStyleItem);
+
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT);
+ XFillGradientItem aFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue(), GetWhich(SID_SW_ATTR_FILL_GRADIENT));
+ rCoreSet.Put(aFillGradientItem);
}
- else if ( SFX_ITEM_DEFAULT == rOldSet.GetItemState( nWhich, false ) )
- rCoreSet.ClearItem( nWhich );
}
else
{
@@ -843,9 +875,19 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
}
else // Brush <-> Bitmap changed!
{
- if ( bIsBrush )
+ if (bIsBrush || bIsGradient)
{
rCoreSet.Put( SvxBrushItem( aBgdColor, nWhich ) );
+ if (bIsGradient)
+ {
+ // Handle XFILL_BITMAP -> XFILL_GRADIENT
+ XFillStyleItem aFillStyleItem(((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue(), GetWhich(SID_SW_ATTR_FILL_STYLE));
+ rCoreSet.Put(aFillStyleItem);
+
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT);
+ XFillGradientItem aFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue(), GetWhich(SID_SW_ATTR_FILL_GRADIENT));
+ rCoreSet.Put(aFillGradientItem);
+ }
}
else
{
@@ -874,7 +916,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet& rCoreSet )
delete pTmpBrush;
}
}
- bModified = ( bIsBrush || m_pBtnLink->IsChecked() || bIsGraphicValid );
+ bModified = ( bIsBrush || bIsGradient || m_pBtnLink->IsChecked() || bIsGraphicValid );
}
}
else if ( SID_ATTR_BRUSH_CHAR == nSlot && aBgdColor != Color( COL_WHITE ) )
@@ -1090,6 +1132,7 @@ void SvxBackgroundTabPage::ShowSelector()
m_pBtnArea->SetClickHdl( HDL(RadioClickHdl_Impl) );
m_pBtnTile->SetClickHdl( HDL(RadioClickHdl_Impl) );
m_pBtnPosition->SetClickHdl( HDL(RadioClickHdl_Impl) );
+ m_pLbGradients->SetSelectHdl(HDL(ModifyGradientHdl_Impl));
// delayed loading via timer (because of UI-Update)
pPageImpl->pLoadTimer = new Timer;
@@ -1178,6 +1221,7 @@ void SvxBackgroundTabPage::ShowColorUI_Impl()
if (!m_pBackGroundColorFrame->IsVisible())
{
HideBitmapUI_Impl();
+ HideGradientUI_Impl();
m_pBackGroundColorFrame->Show();
if(bColTransparency)
@@ -1208,6 +1252,7 @@ void SvxBackgroundTabPage::ShowBitmapUI_Impl()
(m_pBackGroundColorFrame->IsVisible() || !m_pFileFrame->IsVisible()))
{
HideColorUI_Impl();
+ HideGradientUI_Impl();
m_pBitmapContainer->Show();
@@ -1236,6 +1281,36 @@ void SvxBackgroundTabPage::HideBitmapUI_Impl()
m_pGraphTransFrame->Hide();
}
+void SvxBackgroundTabPage::ShowGradientUI_Impl()
+{
+ if (!m_pBackGroundGradientFrame->IsVisible())
+ {
+ HideColorUI_Impl();
+ HideBitmapUI_Impl();
+
+ m_pBackGroundGradientFrame->Show();
+ if (!m_rXFillSet.HasItem(XATTR_FILLSTYLE) || ((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue() != XFILL_GRADIENT)
+ {
+ // Frame has no gradient? Then select the first one, just to be able to show something in the preview control.
+ m_pLbGradients->SelectEntryPos(0);
+ ModifyGradientHdl_Impl(this);
+ }
+ else
+ {
+ // It has one, try to select the matching entry in the gradient list box.
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)m_rXFillSet.Get(XATTR_FILLGRADIENT);
+ m_pLbGradients->SelectEntryByList(m_pGradientList, rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue());
+ }
+ }
+}
+
+void SvxBackgroundTabPage::HideGradientUI_Impl()
+{
+ m_pBackGroundGradientFrame->Hide();
+}
+
+
+
void SvxBackgroundTabPage::SetGraphicPosition_Impl( SvxGraphicPosition ePos )
{
switch ( ePos )
@@ -1334,11 +1409,15 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, SelectHdl_Impl)
ShowColorUI_Impl();
m_pParaLBox->Enable(); // drawing background can't be a bitmap
}
- else
+ else if ( XFILL_BITMAP == lcl_getFillStyle(m_pLbSelect) )
{
ShowBitmapUI_Impl();
m_pParaLBox->Enable(false); // drawing background can't be a bitmap
}
+ else
+ {
+ ShowGradientUI_Impl();
+ }
return 0;
}
@@ -1411,6 +1490,23 @@ IMPL_LINK( SvxBackgroundTabPage, RadioClickHdl_Impl, RadioButton*, pBtn )
return 0;
}
+IMPL_LINK_NOARG(SvxBackgroundTabPage, ModifyGradientHdl_Impl)
+{
+ sal_Int32 nPos = m_pLbGradients->GetSelectEntryPos();
+
+ if (nPos != LISTBOX_ENTRY_NOTFOUND)
+ {
+ XGradientEntry* pEntry = m_pGradientList->GetGradient(nPos);
+ m_rXFillSet.Put( XFillStyleItem( XFILL_GRADIENT ) );
+ m_rXFillSet.Put( XFillGradientItem( pEntry->GetName(), pEntry->GetGradient() ) );
+ }
+ m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_pCtlPreview->Invalidate();
+ return 0;
+}
+
+
+
IMPL_LINK_NOARG(SvxBackgroundTabPage, BrowseHdl_Impl)
/* [Description]
@@ -1714,25 +1810,36 @@ void SvxBackgroundTabPage::FillControls_Impl( const SvxBrushItem& rBgdAttr,
if ( GPOS_NONE == ePos || !m_pLbSelect->IsVisible() )
{
- lcl_setFillStyle(m_pLbSelect, XFILL_SOLID);
- ShowColorUI_Impl();
- Color aTrColor( COL_TRANSPARENT );
- aBgdColor = rColor;
+ // We don't have a graphic, do we have gradient fill style?
+ if (!m_rXFillSet.HasItem(XATTR_FILLSTYLE) || ((const XFillStyleItem&)m_rXFillSet.Get(XATTR_FILLSTYLE)).GetValue() != XFILL_GRADIENT)
+ {
+ lcl_setFillStyle(m_pLbSelect, XFILL_SOLID);
+ ShowColorUI_Impl();
+ Color aTrColor( COL_TRANSPARENT );
+ aBgdColor = rColor;
- sal_uInt16 nCol = ( aTrColor != aBgdColor ) ?
- GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor) : 0;
+ sal_uInt16 nCol = ( aTrColor != aBgdColor ) ?
+ GetItemId_Impl(*m_pBackgroundColorSet, aBgdColor) : 0;
- if( aTrColor != aBgdColor && nCol == 0)
- {
- m_pBackgroundColorSet->SetNoSelection();
+ if( aTrColor != aBgdColor && nCol == 0)
+ {
+ m_pBackgroundColorSet->SetNoSelection();
+ }
+ else
+ {
+ m_pBackgroundColorSet->SelectItem( nCol );
+ }
+
+ m_pPreviewWin1->NotifyChange( aBgdColor );
}
else
{
- m_pBackgroundColorSet->SelectItem( nCol );
+ // Gradient fill style, then initialize preview with data from Writer.
+ lcl_setFillStyle(m_pLbSelect, XFILL_GRADIENT);
+ ShowGradientUI_Impl();
+ m_pCtlPreview->SetAttributes( m_aXFillAttr.GetItemSet() );
+ m_pCtlPreview->Invalidate();
}
-
- m_pPreviewWin1->NotifyChange( aBgdColor );
-
if ( m_pLbSelect->IsVisible() ) // initialize graphic part
{
aBgdGraphicFilter = "";
@@ -1835,6 +1942,7 @@ void SvxBackgroundTabPage::EnableTransparency(bool bColor, bool bGraphic)
void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
{
SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_FLAG_TYPE,false);
+ SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,false);
if (pFlagItem)
{
@@ -1848,6 +1956,25 @@ void SvxBackgroundTabPage::PageCreated(const SfxAllItemSet& aSet)
if ( ( nFlags & SVX_ENABLE_TRANSPARENCY ) == SVX_ENABLE_TRANSPARENCY )
EnableTransparency(true, true);
}
+
+ if (pGradientListItem)
+ {
+ // If we get a gradient list, also read fill and gradient style.
+ m_pGradientList = pGradientListItem->GetGradientList();
+ m_pLbGradients->Fill(m_pGradientList);
+ const XFillStyleItem& rFillStyleItem = (const XFillStyleItem&)aSet.Get(SID_SW_ATTR_FILL_STYLE);
+ m_rXFillSet.Put(XFillStyleItem(rFillStyleItem.GetValue()));
+ const XFillGradientItem& rFillGradientItem = (const XFillGradientItem&)aSet.Get(SID_SW_ATTR_FILL_GRADIENT);
+ m_rXFillSet.Put(XFillGradientItem(rFillGradientItem.GetName(), rFillGradientItem.GetGradientValue()));
+ }
+ else
+ // Otherwise hide the gradient UI.
+ for (int i = 0; i < m_pLbSelect->GetEntryCount(); ++i)
+ if ((XFillStyle)(sal_uLong)m_pLbSelect->GetEntryData(i) == XFILL_GRADIENT)
+ {
+ m_pLbSelect->RemoveEntry(i);
+ break;
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/strings.src b/cui/source/tabpages/strings.src
index 9de66cc..7eefbe5 100644
--- a/cui/source/tabpages/strings.src
+++ b/cui/source/tabpages/strings.src
@@ -191,9 +191,5 @@ String RID_SVXSTR_DIMENSION_LINE
{
Text [en-US ] = "Dimension line";
};
-String RID_SVXSTR_READ_DATA_ERROR
-{
- Text [ en-US ] = "The file could not be loaded!" ;
-};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index 3fcdbce..a27d321 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -40,7 +40,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
Window* pParent,
const SfxItemSet* pAttr,
SdrModel* pModel,
- bool bShadow
+ const SdrView* /* pSdrView */
)
: SfxTabDialog( pParent,
"AreaDialog",
@@ -74,16 +74,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
mbAreaTP( false )
{
m_nAreaTabPage = AddTabPage( "RID_SVXPAGE_AREA", SvxAreaTabPage::Create, 0 );
-
- if(bShadow)
- {
- m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, 0 );
- }
- else
- {
- RemoveTabPage( "RID_SVXPAGE_SHADOW" );
- }
-
+ m_nShadowTabPage = AddTabPage( "RID_SVXPAGE_SHADOW", SvxShadowTabPage::Create, 0 );
m_nTransparenceTabPage = AddTabPage( "RID_SVXPAGE_TRANSPARENCE", SvxTransparenceTabPage::Create, 0);
m_nColorTabPage = AddTabPage( "RID_SVXPAGE_COLOR", SvxColorTabPage::Create, 0 );
m_nGradientTabPage = AddTabPage( "RID_SVXPAGE_GRADIENT", SvxGradientTabPage::Create, 0 );
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index eb0add4..35db8ef 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -41,10 +41,6 @@
#include <sfx2/request.hxx>
#include "paragrph.hrc"
-//UUUU
-#include "sfx2/opengrf.hxx"
-#include <vcl/msgbox.hxx>
-
// static ----------------------------------------------------------------
static const sal_uInt16 pAreaRanges[] =
@@ -591,34 +587,20 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
pHatchingList( NULL ),
pBitmapList( NULL ),
- // local fixed not o be changed values for local pointers
- maFixed_ChangeType(CT_NONE),
- maFixed_sal_Bool(false),
-
- // init with pointers to fixed ChangeType
- pnColorListState(&maFixed_ChangeType),
- pnBitmapListState(&maFixed_ChangeType),
- pnGradientListState(&maFixed_ChangeType),
- pnHatchingListState(&maFixed_ChangeType),
+ pnColorListState( 0 ),
+ pnBitmapListState( 0 ),
+ pnGradientListState( 0 ),
+ pnHatchingListState( 0 ),
- nPageType(0),
- nDlgType(0),
- nPos(0),
+ nPageType( 0 ),
+ nDlgType( 0 ),
+ nPos( LISTBOX_ENTRY_NOTFOUND ),
- // init with pointer to fixed bool
- pbAreaTP(&maFixed_sal_Bool),
+ pbAreaTP( 0 ),
pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
aXFillAttr ( pXPool ),
- rXFSet ( aXFillAttr.GetItemSet() ),
-
- ePoolUnit(SFX_MAPUNIT_100TH_MM),
- eFUnit(FUNIT_NONE),
-
- //UUUU
- mbOfferImportButton(false),
- mbDirectGraphicSet(false),
- maDirectGraphic()
+ rXFSet ( aXFillAttr.GetItemSet() )
{
get(m_pTypeLB,"LB_AREA_TYPE");
get(m_pFillLB,"boxLB_FILL");
@@ -659,7 +641,6 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
get(m_pFlOffset,"FL_OFFSET");
get(m_pRbtRow,"RBT_ROW");
get(m_pRbtColumn,"RBT_COLUMN");
- get(m_pBtnImport, "btnimport");
get(m_pMtrFldOffset,"MTR_FLD_OFFSET");
get(m_pCtlXRectPreview,"CTL_COLOR_PREVIEW");
@@ -723,8 +704,6 @@ SvxAreaTabPage::SvxAreaTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
m_pLbColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyColorHdl_Impl ) );
m_pLbHatchBckgrdColor->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchBckgrdColorHdl_Impl ) );
m_pCbxHatchBckgrd->SetToggleHdl( LINK( this, SvxAreaTabPage, ToggleHatchBckgrdColorHdl_Impl ) );
- //UUUU
- m_pBtnImport->SetClickHdl(LINK(this, SvxAreaTabPage, ClickImportHdl_Impl));
m_pLbGradient->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyGradientHdl_Impl ) );
m_pLbHatching->SetSelectHdl( LINK( this, SvxAreaTabPage, ModifyHatchingHdl_Impl ) );
@@ -1122,44 +1101,33 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet& rAttrs )
break;
case XFILL_BITMAP:
{
- //UUUU
- if(mbDirectGraphicSet && GRAPHIC_NONE != maDirectGraphic.GetType())
- {
- const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic);
- rAttrs.Put(XFillStyleItem(XFILL_BITMAP));
- rAttrs.Put(aXBmpItem);
- bModified = true;
- }
- else
+ nPos = m_pLbBitmap->GetSelectEntryPos();
+ if( nPos != LISTBOX_ENTRY_NOTFOUND &&
+ nPos != m_pLbBitmap->GetSavedValue() )
{
- nPos = m_pLbBitmap->GetSelectEntryPos();
- if( nPos != LISTBOX_ENTRY_NOTFOUND &&
- m_pLbBitmap->IsValueChangedFromSaved() )
+ const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos);
+ const OUString aString(m_pLbBitmap->GetSelectEntry());
+ const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject());
+ pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP );
+ if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
{
- const XBitmapEntry* pXBitmapEntry = pBitmapList->GetBitmap(nPos);
- const OUString aString(m_pLbBitmap->GetSelectEntry());
- const XFillBitmapItem aFillBitmapItem(aString, pXBitmapEntry->GetGraphicObject());
- pOld = GetOldItem( rAttrs, XATTR_FILLBITMAP );
- if ( !pOld || !( *(const XFillBitmapItem*)pOld == aFillBitmapItem ) )
- {
- rAttrs.Put( aFillBitmapItem );
- bModified = true;
- }
+ rAttrs.Put( aFillBitmapItem );
+ bModified = true;
}
- // NEW
- if( (eSavedStyle != eStyle) &&
- ( bModified ||
- SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), true ) ) )
+ }
+ // NEW
+ if( (eSavedStyle != eStyle) &&
+ ( bModified ||
+ SFX_ITEM_SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLBITMAP ), true ) ) )
+ {
+ XFillStyleItem aStyleItem( XFILL_BITMAP );
+ pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
+ if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
{
- XFillStyleItem aStyleItem( XFILL_BITMAP );
- pOld = GetOldItem( rAttrs, XATTR_FILLSTYLE );
- if ( !pOld || !( *(const XFillStyleItem*)pOld == aStyleItem ) )
- {
- rAttrs.Put( aStyleItem );
- bModified = true;
- }
+ rAttrs.Put( aStyleItem );
+ bModified = true;
}
- }
+ }
}
break;
}
@@ -1825,6 +1793,21 @@ void SvxAreaTabPage::ClickColorHdl_Impl()
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pColorList->GetPath() );
+
+ aURL.Append( pColorList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyColorHdl_Impl( this );
}
@@ -1880,6 +1863,21 @@ void SvxAreaTabPage::ClickGradientHdl_Impl()
// Controls for Hatch-Background
m_pFlHatchBckgrd->Hide();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pGradientList->GetPath() );
+
+ aURL.Append( pGradientList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyGradientHdl_Impl( this );
ModifyStepCountHdl_Impl( m_pTsbStepCount );
}
@@ -1935,6 +1933,21 @@ void SvxAreaTabPage::ClickHatchingHdl_Impl()
m_pCbxHatchBckgrd->Enable();
m_pLbHatchBckgrdColor->Enable();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pHatchingList->GetPath() );
+
+ aURL.Append( pHatchingList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyHatchingHdl_Impl( this );
ModifyHatchBckgrdColorHdl_Impl( this );
ToggleHatchBckgrdColorHdl_Impl( this );
@@ -2026,19 +2039,6 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl()
m_pLbColor->Hide();
m_pLbGradient->Hide();
m_pLbHatching->Hide();
-
- //UUUU
- if(mbOfferImportButton)
- {
- m_pBtnImport->Show();
- m_pBtnImport->Enable();
- }
- else
- {
- m_pBtnImport->Hide();
- m_pBtnImport->Disable();
- }
-
m_pLbBitmap->Enable();
m_pLbBitmap->Show();
m_pCtlBitmapPreview->Enable();
@@ -2061,6 +2061,21 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl()
m_pBxBitmap->Show();
+ // set table text
+ OUString aString( CUI_RES( RID_SVXSTR_TABLE ) ); aString += ": ";
+ INetURLObject aURL( pBitmapList->GetPath() );
+
+ aURL.Append( pBitmapList->GetName() );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
+
+ if( aURL.getBase().getLength() > 18 )
+ {
+ aString += aURL.getBase().copy( 0, 15 );
+ aString += "...";
+ }
+ else
+ aString += aURL.getBase();
+
ModifyBitmapHdl_Impl( this );
ModifyTileHdl_Impl( m_pTsbOriginal );
}
@@ -2069,11 +2084,6 @@ void SvxAreaTabPage::ClickBitmapHdl_Impl()
IMPL_LINK_NOARG(SvxAreaTabPage, ModifyBitmapHdl_Impl)
{
- //UUUU
- mbDirectGraphicSet = false;
- maDirectGraphic.Clear();
- maDirectName = "";
-
const SfxPoolItem* pPoolItem = NULL;
sal_Int32 _nPos = m_pLbBitmap->GetSelectEntryPos();
if( _nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -2129,99 +2139,41 @@ IMPL_LINK( SvxAreaTabPage, ModifyStepCountHdl_Impl, void *, p )
return( 0L );
}
-IMPL_LINK_NOARG( SvxAreaTabPage, ClickImportHdl_Impl )
-{
- ResMgr& rMgr = CUI_MGR();
- SvxOpenGraphicDialog aDlg("Import");
- aDlg.EnableLink(false);
-
- if(!aDlg.Execute())
- {
- EnterWait();
- const int nError(aDlg.GetGraphic(maDirectGraphic));
- LeaveWait();
-
- if(!nError && GRAPHIC_NONE != maDirectGraphic.GetType())
- {
- // extract name from filename
- const INetURLObject aURL(aDlg.GetPath());
- maDirectName = aURL.GetName().getToken( 0, '.' );
-
- // use loaded graphic
- const XFillBitmapItem aXBmpItem(maDirectName, maDirectGraphic);
- rXFSet.Put(XFillStyleItem(XFILL_BITMAP));
- rXFSet.Put(aXBmpItem);
- // trigger state flag for directly loaded graphic
- mbDirectGraphicSet = true;
-
- // preview
- m_pCtlBitmapPreview->SetAttributes(aXFillAttr.GetItemSet());
- m_pCtlBitmapPreview->Invalidate();
- }
- else
- {
- // graphic could not be loaded
- ErrorBox(this, WB_OK, OUString(ResId(RID_SVXSTR_READ_DATA_ERROR, rMgr))).Execute();
- }
- }
-
- return 0L;
-}
-
-//------------------------------------------------------------------------
IMPL_LINK_NOARG(SvxAreaTabPage, ModifyTileHdl_Impl)
{
TriState eState = m_pTsbTile->GetState();
if( eState == TRISTATE_TRUE )
{
- // tiled
- // disable stretched for tiled graphic
m_pTsbStretch->Disable();
m_pFlOffset->Enable();
- // allow positioning
m_pCtlPosition->Invalidate();
- // allow 'Position" title
m_pFlPosition->Enable();
- // allow size definitions
m_pFlSize->Enable();
}
else if( eState == TRISTATE_FALSE )
{
- // non-tiled
- // enable stretch selection
m_pTsbStretch->Enable();
- // no need for offsets, only position is supported in non-tiled
m_pFlOffset->Disable();
+ m_pCtlPosition->Invalidate();
+ m_pFlPosition->Disable();
+
if( m_pTsbStretch->GetState() != TRISTATE_FALSE )
{
- // non-tiled, stretched
- // no need for positioning
- m_pCtlPosition->Invalidate();
- // no need for 'Position" title, all deactivated
- m_pFlPosition->Disable();
- // no need for size definitions
m_pFlSize->Disable();
}
else
{
- // non-tiled, non-stretched
- // allow positioning
- m_pCtlPosition->Enable();
- m_pCtlPosition->Invalidate();
- // allow 'Position" title, positioning is active
- m_pFlPosition->Enable();
m_pFlSize->Enable();
}
}
else
{
- // disable all when tiling is undefined
m_pTsbStretch->Disable();
m_pFlOffset->Disable();
@@ -2383,8 +2335,6 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet)
SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,false);
SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,false);
SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,false);
- //UUUU
- SFX_ITEMSET_ARG (&aSet, pOfferImportItem, SfxBoolItem, SID_OFFER_IMPORT, false);
if (pColorListItem)
SetColorList(pColorListItem->GetColorList());
@@ -2400,18 +2350,6 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet)
SetDlgType(pDlgTypeItem->GetValue());
if (pPosItem)
SetPos(pPosItem->GetValue());
-
- //UUUU
- if(pOfferImportItem)
- {
- const bool bNew(pOfferImportItem->GetValue());
-
- if(mbOfferImportButton != bNew)
- {
- mbOfferImportButton = bNew;
- }
- }
-
Construct();
}
diff --git a/cui/uiconfig/ui/areatabpage.ui b/cui/uiconfig/ui/areatabpage.ui
index 689778e..96f2912 100644
--- a/cui/uiconfig/ui/areatabpage.ui
+++ b/cui/uiconfig/ui/areatabpage.ui
@@ -821,19 +821,6 @@
<property name="position">3</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="btnimport">
- <property name="label" translatable="yes">Import Graphic...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
index 2e7f05e..669ee49 100644
--- a/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
+++ b/drawinglayer/source/attribute/sdrfillgraphicattribute.cxx
@@ -209,11 +209,11 @@ namespace drawinglayer
// get logical size of bitmap (before expanding eventually)
Graphic aGraphic(getFillGraphic());
- // init values with defaults for stretched
+ // init values with defaults
basegfx::B2DPoint aBitmapSize(1.0, 1.0);
basegfx::B2DVector aBitmapTopLeft(0.0, 0.0);
- //UUUU are changes needed? When streched we are already done, all other values will have no influence
+ // are changes needed?
if(getTiling() || !getStretch())
{
// init values with range sizes
@@ -258,33 +258,34 @@ namespace drawinglayer
aBitmapSize.setY(getGraphicLogicSize().getY());
}
+ // get values, force to centered if necessary
+ const basegfx::B2DVector aRectPoint(getTiling() ? getRectPoint() : basegfx::B2DVector(0.0, 0.0));
+
// position changes X
- if(0.0 == getRectPoint().getX())
+ if(0.0 == aRectPoint.getX())
{
aBitmapTopLeft.setX((fRangeWidth - aBitmapSize.getX()) * 0.5);
}
- else if(1.0 == getRectPoint().getX())
+ else if(1.0 == aRectPoint.getX())
{
aBitmapTopLeft.setX(fRangeWidth - aBitmapSize.getX());
}
- // offset positions are only meaningful when tiled
if(getTiling() && 0.0 != getOffsetPosition().getX())
{
aBitmapTopLeft.setX(aBitmapTopLeft.getX() + (aBitmapSize.getX() * (getOffsetPosition().getX() * 0.01)));
}
// position changes Y
- if(0.0 == getRectPoint().getY())
+ if(0.0 == aRectPoint.getY())
{
aBitmapTopLeft.setY((fRangeHeight - aBitmapSize.getY()) * 0.5);
}
- else if(1.0 == getRectPoint().getY())
+ else if(1.0 == aRectPoint.getY())
{
aBitmapTopLeft.setY(fRangeHeight - aBitmapSize.getY());
}
- // offset positions are only meaningful when tiled
if(getTiling() && 0.0 != getOffsetPosition().getY())
{
aBitmapTopLeft.setY(aBitmapTopLeft.getY() + (aBitmapSize.getY() * (getOffsetPosition().getY() * 0.01)));
diff --git a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
index f5be906..575c6b3 100644
--- a/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx
@@ -37,7 +37,7 @@ namespace drawinglayer
{
void FillGradientPrimitive2D::generateMatricesAndColors(
std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
- basegfx::BColor& rOuterColor) const
+ basegfx::BColor& rOutmostColor) const
{
rEntries.clear();
@@ -68,83 +68,38 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- texture::GeoTexSvxGradientLinear aGradient(
- getDefinitionRange(),
- getOutputRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getAngle());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientLinear aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- texture::GeoTexSvxGradientAxial aGradient(
- getDefinitionRange(),
- getOutputRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getAngle());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientAxial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getAngle());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- texture::GeoTexSvxGradientRadial aGradient(
- getDefinitionRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getOffsetX(),
- getFillGradient().getOffsetY());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientRadial aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- texture::GeoTexSvxGradientElliptical aGradient(
- getDefinitionRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getOffsetX(),
- getFillGradient().getOffsetY(),
- getFillGradient().getAngle());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientElliptical aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- texture::GeoTexSvxGradientSquare aGradient(
- getDefinitionRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getOffsetX(),
- getFillGradient().getOffsetY(),
- getFillGradient().getAngle());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientSquare aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- texture::GeoTexSvxGradientRect aGradient(
- getDefinitionRange(),
- aStart,
- aEnd,
- nSteps,
- getFillGradient().getBorder(),
- getFillGradient().getOffsetX(),
- getFillGradient().getOffsetY(),
- getFillGradient().getAngle());
- aGradient.appendTransformationsAndColors(rEntries, rOuterColor);
+ texture::GeoTexSvxGradientRect aGradient(getObjectRange(), aStart, aEnd, nSteps, getFillGradient().getBorder(), getFillGradient().getOffsetX(), getFillGradient().getOffsetY(), getFillGradient().getAngle());
+ aGradient.appendTransformationsAndColors(rEntries, rOutmostColor);
break;
}
}
@@ -152,7 +107,7 @@ namespace drawinglayer
Primitive2DSequence FillGradientPrimitive2D::createOverlappingFill(
const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
- const basegfx::BColor& rOuterColor,
+ const basegfx::BColor& rOutmostColor,
const basegfx::B2DPolygon& rUnitPolygon) const
{
// prepare return value
@@ -161,9 +116,8 @@ namespace drawinglayer
// create solid fill with outmost color
aRetval[0] = Primitive2DReference(
new PolyPolygonColorPrimitive2D(
- basegfx::B2DPolyPolygon(
- basegfx::tools::createPolygonFromRect(getOutputRange())),
- rOuterColor));
+ basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(getObjectRange())),
+ rOutmostColor));
// create solid fill steps
for(sal_uInt32 a(0); a < rEntries.size(); a++)
@@ -185,14 +139,14 @@ namespace drawinglayer
Primitive2DSequence FillGradientPrimitive2D::createNonOverlappingFill(
const std::vector< drawinglayer::texture::B2DHomMatrixAndBColor >& rEntries,
- const basegfx::BColor& rOuterColor,
+ const basegfx::BColor& rOutmostColor,
const basegfx::B2DPolygon& rUnitPolygon) const
{
// prepare return value
Primitive2DSequence aRetval(rEntries.size() + 1);
- // get outmost viusible range from object
- basegfx::B2DRange aOutmostRange(getOutputRange());
+ // get outmost range from object
+ basegfx::B2DRange aOutmostRange(getObjectRange());
basegfx::B2DPolyPolygon aCombinedPolyPoly;
if(rEntries.size())
@@ -210,7 +164,7 @@ namespace drawinglayer
aRetval[0] = Primitive2DReference(
new PolyPolygonColorPrimitive2D(
aCombinedPolyPoly,
- rOuterColor));
+ rOutmostColor));
if(rEntries.size())
{
@@ -268,17 +222,17 @@ namespace drawinglayer
// get the transform matrices and colors (where colors
// will have one more entry that matrices)
std::vector< drawinglayer::texture::B2DHomMatrixAndBColor > aEntries;
- basegfx::BColor aOuterColor;
+ basegfx::BColor aOutmostColor;
- generateMatricesAndColors(aEntries, aOuterColor);
+ generateMatricesAndColors(aEntries, aOutmostColor);
if(bOverlapping)
{
- return createOverlappingFill(aEntries, aOuterColor, aUnitPolygon);
+ return createOverlappingFill(aEntries, aOutmostColor, aUnitPolygon);
}
else
{
- return createNonOverlappingFill(aEntries, aOuterColor, aUnitPolygon);
+ return createNonOverlappingFill(aEntries, aOutmostColor, aUnitPolygon);
}
}
@@ -304,22 +258,10 @@ namespace drawinglayer
}
FillGradientPrimitive2D::FillGradientPrimitive2D(
- const basegfx::B2DRange& rOutputRange,
+ const basegfx::B2DRange& rObjectRange,
const attribute::FillGradientAttribute& rFillGradient)
: BufferedDecompositionPrimitive2D(),
- maOutputRange(rOutputRange),
- maDefinitionRange(rOutputRange),
- maFillGradient(rFillGradient)
- {
- }
-
- FillGradientPrimitive2D::FillGradientPrimitive2D(
- const basegfx::B2DRange& rOutputRange,
- const basegfx::B2DRange& rDefinitionRange,
- const attribute::FillGradientAttribute& rFillGradient)
- : BufferedDecompositionPrimitive2D(),
- maOutputRange(rOutputRange),
- maDefinitionRange(rDefinitionRange),
+ maObjectRange(rObjectRange),
maFillGradient(rFillGradient)
{
}
@@ -330,8 +272,7 @@ namespace drawinglayer
{
const FillGradientPrimitive2D& rCompare = (FillGradientPrimitive2D&)rPrimitive;
- return (getOutputRange() == rCompare.getOutputRange()
- && getDefinitionRange() == rCompare.getDefinitionRange()
+ return (getObjectRange() == rCompare.getObjectRange()
&& getFillGradient() == rCompare.getFillGradient());
}
@@ -340,8 +281,8 @@ namespace drawinglayer
basegfx::B2DRange FillGradientPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // return the geometrically visible area
- return getOutputRange();
+ // return ObjectRange
+ return getObjectRange();
}
// provide unique ID
diff --git a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
index cbad4a1..1f941d0 100644
--- a/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx
@@ -67,12 +67,7 @@ namespace drawinglayer
case attribute::HATCHSTYLE_TRIPLE:
{
// rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(
- getDefinitionRange(),
- getOutputRange(),
- fDistance,
- fAngle - F_PI4);
-
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle - F_PI4);
aHatch.appendTransformations(aMatrices);
// fall-through by purpose
@@ -80,12 +75,7 @@ namespace drawinglayer
case attribute::HATCHSTYLE_DOUBLE:
{
// rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(
- getDefinitionRange(),
- getOutputRange(),
- fDistance,
- fAngle - F_PI2);
-
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle - F_PI2);
aHatch.appendTransformations(aMatrices);
// fall-through by purpose
@@ -93,12 +83,7 @@ namespace drawinglayer
case attribute::HATCHSTYLE_SINGLE:
{
// angle as given
- texture::GeoTexSvxHatch aHatch(
- getDefinitionRange(),
- getOutputRange(),
- fDistance,
- fAngle);
-
+ texture::GeoTexSvxHatch aHatch(getObjectRange(), fDistance, fAngle);
aHatch.appendTransformations(aMatrices);
}
}
@@ -114,7 +99,7 @@ namespace drawinglayer
const Primitive2DReference xRef(
new PolyPolygonColorPrimitive2D(
basegfx::B2DPolyPolygon(
- basegfx::tools::createPolygonFromRect(getOutputRange())), getBColor()));
+ basegfx::tools::createPolygonFromRect(getObjectRange())), getBColor()));
aRetval[0] = xRef;
}
@@ -140,25 +125,11 @@ namespace drawinglayer
}
FillHatchPrimitive2D::FillHatchPrimitive2D(
- const basegfx::B2DRange& rOutputRange,
- const basegfx::BColor& rBColor,
- const attribute::FillHatchAttribute& rFillHatch)
- : DiscreteMetricDependentPrimitive2D(),
- maOutputRange(rOutputRange),
- maDefinitionRange(rOutputRange),
- maFillHatch(rFillHatch),
- maBColor(rBColor)
- {
- }
-
- FillHatchPrimitive2D::FillHatchPrimitive2D(
- const basegfx::B2DRange& rOutputRange,
- const basegfx::B2DRange& rDefinitionRange,
+ const basegfx::B2DRange& rObjectRange,
const basegfx::BColor& rBColor,
const attribute::FillHatchAttribute& rFillHatch)
: DiscreteMetricDependentPrimitive2D(),
- maOutputRange(rOutputRange),
- maDefinitionRange(rDefinitionRange),
+ maObjectRange(rObjectRange),
maFillHatch(rFillHatch),
maBColor(rBColor)
{
@@ -170,8 +141,7 @@ namespace drawinglayer
{
const FillHatchPrimitive2D& rCompare = (FillHatchPrimitive2D&)rPrimitive;
- return (getOutputRange() == rCompare.getOutputRange()
- && getDefinitionRange() == rCompare.getDefinitionRange()
+ return (getObjectRange() == rCompare.getObjectRange()
&& getFillHatch() == rCompare.getFillHatch()
&& getBColor() == rCompare.getBColor());
}
@@ -181,8 +151,8 @@ namespace drawinglayer
basegfx::B2DRange FillHatchPrimitive2D::getB2DRange(const geometry::ViewInformation2D& /*rViewInformation*/) const
{
- // return the geometrically visible area
- return getOutputRange();
+ // return ObjectRange
+ return getObjectRange();
}
Primitive2DSequence FillHatchPrimitive2D::get2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const
diff --git a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
index 1fe0a6f..0f33f9c 100644
--- a/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/polypolygonprimitive2d.cxx
@@ -201,7 +201,7 @@ namespace drawinglayer
PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const attribute::LineAttribute& rLineAttribute,
+ const attribute::LineAttribute& rLineAttribute,
const attribute::StrokeAttribute& rStrokeAttribute)
: BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
@@ -212,7 +212,7 @@ namespace drawinglayer
PolyPolygonStrokePrimitive2D::PolyPolygonStrokePrimitive2D(
const basegfx::B2DPolyPolygon& rPolyPolygon,
- const attribute::LineAttribute& rLineAttribute)
+ const attribute::LineAttribute& rLineAttribute)
: BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
maLineAttribute(rLineAttribute),
@@ -306,10 +306,7 @@ namespace drawinglayer
{
// create SubSequence with FillGradientPrimitive2D
const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(
- aPolyPolygonRange,
- getDefinitionRange(),
- getFillGradient());
+ FillGradientPrimitive2D* pNewGradient = new FillGradientPrimitive2D(aPolyPolygonRange, getFillGradient());
const Primitive2DReference xSubRef(pNewGradient);
const Primitive2DSequence aSubSequence(&xSubRef, 1L);
@@ -330,18 +327,6 @@ namespace drawinglayer
const attribute::FillGradientAttribute& rFillGradient)
: BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rPolyPolygon.getB2DRange()),
- maFillGradient(rFillGradient)
- {
- }
-
- PolyPolygonGradientPrimitive2D::PolyPolygonGradientPrimitive2D(
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::B2DRange& rDefinitionRange,
- const attribute::FillGradientAttribute& rFillGradient)
- : BufferedDecompositionPrimitive2D(),
- maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rDefinitionRange),
maFillGradient(rFillGradient)
{
}
@@ -352,9 +337,7 @@ namespace drawinglayer
{
const PolyPolygonGradientPrimitive2D& rCompare = (PolyPolygonGradientPrimitive2D&)rPrimitive;
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getDefinitionRange() == rCompare.getDefinitionRange()
- && getFillGradient() == rCompare.getFillGradient());
+ return (getFillGradient() == rCompare.getFillGradient());
}
return false;
@@ -378,11 +361,7 @@ namespace drawinglayer
{
// create SubSequence with FillHatchPrimitive2D
const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
- FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(
- aPolyPolygonRange,
- getDefinitionRange(),
- getBackgroundColor(),
- getFillHatch());
+ FillHatchPrimitive2D* pNewHatch = new FillHatchPrimitive2D(aPolyPolygonRange, getBackgroundColor(), getFillHatch());
const Primitive2DReference xSubRef(pNewHatch);
const Primitive2DSequence aSubSequence(&xSubRef, 1L);
@@ -404,20 +383,6 @@ namespace drawinglayer
const attribute::FillHatchAttribute& rFillHatch)
: BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rPolyPolygon.getB2DRange()),
- maBackgroundColor(rBackgroundColor),
- maFillHatch(rFillHatch)
- {
- }
-
- PolyPolygonHatchPrimitive2D::PolyPolygonHatchPrimitive2D(
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::B2DRange& rDefinitionRange,
- const basegfx::BColor& rBackgroundColor,
- const attribute::FillHatchAttribute& rFillHatch)
- : BufferedDecompositionPrimitive2D(),
- maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rDefinitionRange),
maBackgroundColor(rBackgroundColor),
maFillHatch(rFillHatch)
{
@@ -429,9 +394,7 @@ namespace drawinglayer
{
const PolyPolygonHatchPrimitive2D& rCompare = (PolyPolygonHatchPrimitive2D&)rPrimitive;
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getDefinitionRange() == rCompare.getDefinitionRange()
- && getBackgroundColor() == rCompare.getBackgroundColor()
+ return (getBackgroundColor() == rCompare.getBackgroundColor()
&& getFillHatch() == rCompare.getFillHatch());
}
@@ -466,56 +429,15 @@ namespace drawinglayer
if(aPrefSize.Width() && aPrefSize.Height())
{
// create SubSequence with FillGraphicPrimitive2D based on polygon range
- const basegfx::B2DRange aOutRange(getB2DPolyPolygon().getB2DRange());
+ const basegfx::B2DRange aPolyPolygonRange(getB2DPolyPolygon().getB2DRange());
const basegfx::B2DHomMatrix aNewObjectTransform(
basegfx::tools::createScaleTranslateB2DHomMatrix(
- aOutRange.getRange(),
- aOutRange.getMinimum()));
- Primitive2DReference xSubRef;
-
- if(aOutRange != getDefinitionRange())
- {
- // we want to paint (tiled) content which is defined relative to DefinitionRange
- // with the same tiling and offset(s) in the traget range of the geometry (the
- // polygon). The range given in the local FillGraphicAttribute defines the position
- // of the graphic in unit coordinates relative to the DefinitionRange. Transform
- // this using DefinitionRange to get to the global definition and then with the
- // inverse transformation from the target range to go to unit coordinates relative
- // to that traget coordinate system.
- basegfx::B2DRange aAdaptedRange(getFillGraphic().getGraphicRange());
-
- const basegfx::B2DHomMatrix aFromDefinitionRangeToGlobal(
- basegfx::tools::createScaleTranslateB2DHomMatrix(
- getDefinitionRange().getRange(),
- getDefinitionRange().getMinimum()));
-
- aAdaptedRange.transform(aFromDefinitionRangeToGlobal);
-
- basegfx::B2DHomMatrix aFromGlobalToOutRange(
- basegfx::tools::createScaleTranslateB2DHomMatrix(
- aOutRange.getRange(),
- aOutRange.getMinimum()));
- aFromGlobalToOutRange.invert();
-
- aAdaptedRange.transform(aFromGlobalToOutRange);
-
- const drawinglayer::attribute::FillGraphicAttribute aAdaptedFillGraphicAttribute(
- getFillGraphic().getGraphic(),
- aAdaptedRange,
- getFillGraphic().getTiling(),
- getFillGraphic().getOffsetX(),
- getFillGraphic().getOffsetY());
-
- xSubRef = new FillGraphicPrimitive2D(
- aNewObjectTransform,
- aAdaptedFillGraphicAttribute);
- }
- else
- {
- xSubRef = new FillGraphicPrimitive2D(
+ aPolyPolygonRange.getRange(),
+ aPolyPolygonRange.getMinimum()));
+ const Primitive2DReference xSubRef(
+ new FillGraphicPrimitive2D(
aNewObjectTransform,
- getFillGraphic());
- }
+ getFillGraphic()));
// embed to mask primitive
const Primitive2DReference xRef(
@@ -536,18 +458,6 @@ namespace drawinglayer
const attribute::FillGraphicAttribute& rFillGraphic)
: BufferedDecompositionPrimitive2D(),
maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rPolyPolygon.getB2DRange()),
- maFillGraphic(rFillGraphic)
- {
- }
-
- PolyPolygonGraphicPrimitive2D::PolyPolygonGraphicPrimitive2D(
- const basegfx::B2DPolyPolygon& rPolyPolygon,
- const basegfx::B2DRange& rDefinitionRange,
- const attribute::FillGraphicAttribute& rFillGraphic)
- : BufferedDecompositionPrimitive2D(),
- maPolyPolygon(rPolyPolygon),
- maDefinitionRange(rDefinitionRange),
maFillGraphic(rFillGraphic)
{
}
@@ -558,9 +468,7 @@ namespace drawinglayer
{
const PolyPolygonGraphicPrimitive2D& rCompare = (PolyPolygonGraphicPrimitive2D&)rPrimitive;
- return (getB2DPolyPolygon() == rCompare.getB2DPolyPolygon()
- && getDefinitionRange() == rCompare.getDefinitionRange()
- && getFillGraphic() == rCompare.getFillGraphic());
+ return (getFillGraphic() == rCompare.getFillGraphic());
}
return false;
diff --git a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
index 24162d6..20169cb 100644
--- a/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/hatchtextureprimitive3d.cxx
@@ -145,34 +145,19 @@ namespace drawinglayer
case attribute::HATCHSTYLE_TRIPLE:
{
// rotated 45 degrees
- texture::GeoTexSvxHatch aHatch(
- aOutlineRange,
- aOutlineRange,
- getHatch().getDistance(),
- fAngle - F_PI4);
-
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI4);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_DOUBLE:
{
// rotated 90 degrees
- texture::GeoTexSvxHatch aHatch(
- aOutlineRange,
- aOutlineRange,
- getHatch().getDistance(),
- fAngle - F_PI2);
-
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle - F_PI2);
aHatch.appendTransformations(aMatrices);
}
case attribute::HATCHSTYLE_SINGLE:
{
// angle as given
- texture::GeoTexSvxHatch aHatch(
- aOutlineRange,
- aOutlineRange,
- getHatch().getDistance(),
- fAngle);
-
+ texture::GeoTexSvxHatch aHatch(aOutlineRange, getHatch().getDistance(), fAngle);
aHatch.appendTransformations(aMatrices);
}
}
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index d17d0ec..17506ef 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1452,15 +1452,6 @@ namespace drawinglayer
const attribute::FillHatchAttribute& rFillHatchAttribute = rHatchCandidate.getFillHatch();
basegfx::B2DPolyPolygon aLocalPolyPolygon(rHatchCandidate.getB2DPolyPolygon());
- if(aLocalPolyPolygon.getB2DRange() != rHatchCandidate.getDefinitionRange())
- {
- // the range which defines the hatch is different from the range of the
- // geometry (used for writer frames). This cannot be done calling vcl, thus use
- // decomposition here
- process(rCandidate.get2DDecomposition(getViewInformation2D()));
- break;
- }
-
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. Split polygon until there are less than that
while(fillPolyPolygonNeededToBeSplit(aLocalPolyPolygon))
@@ -1583,20 +1574,11 @@ namespace drawinglayer
// BTW: One more example how useful the principles of primitives are; the decomposition
// is by definition a simpler, maybe more expensive representation of the same content.
process(rCandidate.get2DDecomposition(getViewInformation2D()));
- break;
}
-
- const primitive2d::PolyPolygonGradientPrimitive2D& rGradientCandidate = static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate);
- basegfx::B2DPolyPolygon aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());
-
- if(aLocalPolyPolygon.getB2DRange() != rGradientCandidate.getDefinitionRange())
+ else
{
- // the range which defines the gradient is different from the range of the
- // geometry (used for writer frames). This cannot be done calling vcl, thus use
- // decomposition here
- process(rCandidate.get2DDecomposition(getViewInformation2D()));
- break;
- }
+ const primitive2d::PolyPolygonGradientPrimitive2D& rGradientCandidate = static_cast< const primitive2d::PolyPolygonGradientPrimitive2D& >(rCandidate);
+ basegfx::B2DPolyPolygon aLocalPolyPolygon(rGradientCandidate.getB2DPolyPolygon());
// #i112245# Metafiles use tools Polygon and are not able to have more than 65535 points
// per polygon. Split polygon until there are less than that
@@ -1644,27 +1626,28 @@ namespace drawinglayer
break;
}
- pSvtGraphicFill = new SvtGraphicFill(
- aToolsPolyPolygon,
- Color(),
- 0.0,
- SvtGraphicFill::fillEvenOdd,
- SvtGraphicFill::fillGradient,
- SvtGraphicFill::Transform(),
- false,
- SvtGraphicFill::hatchSingle,
- Color(),
- eGrad,
- aVCLGradient.GetStartColor(),
- aVCLGradient.GetEndColor(),
- aVCLGradient.GetSteps(),
- Graphic());
- }
+ pSvtGraphicFill = new SvtGraphicFill(
+ aToolsPolyPolygon,
+ Color(),
+ 0.0,
+ SvtGraphicFill::fillEvenOdd,
+ SvtGraphicFill::fillGradient,
+ SvtGraphicFill::Transform(),
+ false,
+ SvtGraphicFill::hatchSingle,
+ Color(),
+ eGrad,
+ aVCLGradient.GetStartColor(),
+ aVCLGradient.GetEndColor(),
+ aVCLGradient.GetSteps(),
+ Graphic());
+ }
- // call VCL directly; encapsulate with SvtGraphicFill
- impStartSvtGraphicFill(pSvtGraphicFill);
- mpOutputDevice->DrawGradient(aToolsPolyPolygon, aVCLGradient);
- impEndSvtGraphicFill(pSvtGraphicFill);
+ // call VCL directly; encapsulate with SvtGraphicFill
+ impStartSvtGraphicFill(pSvtGraphicFill);
+ mpOutputDevice->DrawGradient(aToolsPolyPolygon, aVCLGradient);
+ impEndSvtGraphicFill(pSvtGraphicFill);
+ }
break;
}
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index 1a4db95..e21a836 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -1102,7 +1102,7 @@ namespace drawinglayer
const attribute::FillHatchAttribute& rFillHatchAttributes = rFillHatchPrimitive.getFillHatch();
// create hatch polygon in range size and discrete coordinates
- basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getOutputRange());
+ basegfx::B2DRange aHatchRange(rFillHatchPrimitive.getObjectRange());
aHatchRange.transform(maCurrentTransformation);
const basegfx::B2DPolygon aHatchPolygon(basegfx::tools::createPolygonFromRect(aHatchRange));
diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
index 38028b2..3808210 100644
--- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx
@@ -91,83 +91,32 @@ namespace drawinglayer
{
case attribute::GRADIENTSTYLE_LINEAR:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientLinear(
- aOutlineRange,
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientLinear(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_AXIAL:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientAxial(
- aOutlineRange,
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientAxial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RADIAL:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientRadial(
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getOffsetX(),
- rFillGradient.getOffsetY()));
+ pNewTex.reset(new texture::GeoTexSvxGradientRadial(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY()));
break;
}
case attribute::GRADIENTSTYLE_ELLIPTICAL:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientElliptical(
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getOffsetX(),
- rFillGradient.getOffsetY(),
- rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientElliptical(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_SQUARE:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientSquare(
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getOffsetX(),
- rFillGradient.getOffsetY(),
- rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientSquare(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
case attribute::GRADIENTSTYLE_RECT:
{
- pNewTex.reset(
- new texture::GeoTexSvxGradientRect(
- aOutlineRange,
- aStart,
- aEnd,
- nSteps,
- rFillGradient.getBorder(),
- rFillGradient.getOffsetX(),
- rFillGradient.getOffsetY(),
- rFillGradient.getAngle()));
+ pNewTex.reset(new texture::GeoTexSvxGradientRect(aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), rFillGradient.getAngle()));
break;
}
}
diff --git a/drawinglayer/source/texture/texture.cxx b/drawinglayer/source/texture/texture.cxx
index e1f8f92..d468f70 100644
--- a/drawinglayer/source/texture/texture.cxx
+++ b/drawinglayer/source/texture/texture.cxx
@@ -67,14 +67,14 @@ namespace drawinglayer
namespace texture
{
GeoTexSvxGradient::GeoTexSvxGradient(
- const basegfx::B2DRange& rDefinitionRange,
+ const basegfx::B2DRange& rTargetRange,
const basegfx::BColor& rStart,
const basegfx::BColor& rEnd,
sal_uInt32 /* nSteps */,
double fBorder)
: GeoTexSvx(),
maGradientInfo(),
- maDefinitionRange(rDefinitionRange),
+ maTargetRange(rTargetRange),
maStart(rStart),
maEnd(rEnd),
mfBorder(fBorder)
@@ -91,7 +91,7 @@ namespace drawinglayer
return (pCompare
&& maGradientInfo == pCompare->maGradientInfo
- && maDefinitionRange == pCompare->maDefinitionRange
+ && maTargetRange == pCompare->maTargetRange
&& mfBorder == pCompare->mfBorder);
}
} // end of namespace texture
@@ -104,33 +104,19 @@ namespace drawinglayer
namespace texture
{
GeoTexSvxGradientLinear::GeoTexSvxGradientLinear(
- const basegfx::B2DRange& rDefinitionRange,
- const basegfx::B2DRange& rOutputRange,
+ const basegfx::B2DRange& rTargetRange,
const basegfx::BColor& rStart,
const basegfx::BColor& rEnd,
sal_uInt32 nSteps,
double fBorder,
double fAngle)
- : GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder),
- mfUnitMinX(0.0),
- mfUnitWidth(1.0),
- mfUnitMaxY(1.0)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
maGradientInfo = basegfx::tools::createLinearODFGradientInfo(
- rDefinitionRange,
+ rTargetRange,
nSteps,
fBorder,
fAngle);
-
- if(rDefinitionRange != rOutputRange)
- {
- basegfx::B2DRange aInvOutputRange(rOutputRange);
-
- aInvOutputRange.transform(maGradientInfo.getBackTextureTransform());
- mfUnitMinX = aInvOutputRange.getMinX();
- mfUnitWidth = aInvOutputRange.getWidth();
- mfUnitMaxY = aInvOutputRange.getMaxY();
- }
}
GeoTexSvxGradientLinear::~GeoTexSvxGradientLinear()
@@ -139,46 +125,29 @@ namespace drawinglayer
void GeoTexSvxGradientLinear::appendTransformationsAndColors(
std::vector< B2DHomMatrixAndBColor >& rEntries,
- basegfx::BColor& rOuterColor)
+ basegfx::BColor& rOutmostColor)
{
- rOuterColor = maStart;
+ rOutmostColor = maStart;
if(maGradientInfo.getSteps())
{
const double fStripeWidth(1.0 / maGradientInfo.getSteps());
B2DHomMatrixAndBColor aB2DHomMatrixAndBColor;
- basegfx::B2DHomMatrix aPattern;
-
- // bring from unit circle [-1, -1, 1, 1] to unit range [0, 0, 1, 1]
- aPattern.scale(0.5, 0.5);
- aPattern.translate(0.5, 0.5);
-
- // scale and translate in X
- aPattern.scale(mfUnitWidth, 1.0);
- aPattern.translate(mfUnitMinX, 0.0);
for(sal_uInt32 a(1); a < maGradientInfo.getSteps(); a++)
{
const double fPos(fStripeWidth * a);
- basegfx::B2DHomMatrix aNew(aPattern);
-
- // scale and translate in Y
- double fHeight(1.0 - fPos);
-
- if(a + 1 == maGradientInfo.getSteps() && mfUnitMaxY > 1.0)
- {
- fHeight += mfUnitMaxY - 1.0;
- }
-
- aNew.scale(1.0, fHeight);
- aNew.translate(0.0, fPos);
-
- // set at target
- aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() * aNew;
-
- // interpolate and set color
+ // optimized below...
+
+ // basegfx::B2DHomMatrix aNew;
+ // aNew.scale(0.5, 0.5);
+ // aNew.translate(0.5, 0.5);
+ // aNew.scale(1.0, (1.0 - fPos));
+ // aNew.translate(0.0, fPos);
+ // aNew = maGradientInfo.getTextureTransform() * aNew;
+ aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() *
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 0.5 * (1.0 - fPos), 0.5, 0.5 * (1.0 + fPos));
aB2DHomMatrixAndBColor.maBColor = interpolate(maStart, maEnd, double(a) / double(maGradientInfo.getSteps() - 1));
-
rEntries.push_back(aB2DHomMatrixAndBColor);
}
}
@@ -200,31 +169,19 @@ namespace drawinglayer
namespace texture
{
GeoTexSvxGradientAxial::GeoTexSvxGradientAxial(
- const basegfx::B2DRange& rDefinitionRange,
- const basegfx::B2DRange& rOutputRange,
+ const basegfx::B2DRange& rTargetRange,
const basegfx::BColor& rStart,
const basegfx::BColor& rEnd,
sal_uInt32 nSteps,
double fBorder,
double fAngle)
- : GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder),
- mfUnitMinX(0.0),
- mfUnitWidth(1.0)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
maGradientInfo = basegfx::tools::createAxialODFGradientInfo(
- rDefinitionRange,
+ rTargetRange,
nSteps,
fBorder,
fAngle);
-
- if(rDefinitionRange != rOutputRange)
- {
- basegfx::B2DRange aInvOutputRange(rOutputRange);
-
- aInvOutputRange.transform(maGradientInfo.getBackTextureTransform());
- mfUnitMinX = aInvOutputRange.getMinX();
- mfUnitWidth = aInvOutputRange.getWidth();
- }
}
GeoTexSvxGradientAxial::~GeoTexSvxGradientAxial()
@@ -233,9 +190,9 @@ namespace drawinglayer
void GeoTexSvxGradientAxial::appendTransformationsAndColors(
std::vector< B2DHomMatrixAndBColor >& rEntries,
- basegfx::BColor& rOuterColor)
+ basegfx::BColor& rOutmostColor)
{
- rOuterColor = maEnd;
+ rOutmostColor = maEnd;
if(maGradientInfo.getSteps())
{
@@ -244,26 +201,16 @@ namespace drawinglayer
for(sal_uInt32 a(1); a < maGradientInfo.getSteps(); a++)
{
- const double fPos(fStripeWidth * a);
- basegfx::B2DHomMatrix aNew;
-
- // bring in X from unit circle [-1, -1, 1, 1] to unit range [0, 0, 1, 1]
- aNew.scale(0.5, 1.0);
- aNew.translate(0.5, 0.0);
-
- // scale/translate in X
- aNew.scale(mfUnitWidth, 1.0);
- aNew.translate(mfUnitMinX, 0.0);
-
- // already centerd in Y on X-Axis, just scale in Y
- aNew.scale(1.0, 1.0 - fPos);
-
- // set at target
- aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() * aNew;
-
- // interpolate and set color
+ // const double fPos(fStripeWidth * a);
+ // optimized below...
+
+ // basegfx::B2DHomMatrix aNew;
+ // aNew.scale(0.50, (1.0 - fPos));
+ // aNew.translate(0.5, 0.0);
+ // aNew = maGradientInfo.getTextureTransform() * aNew;
+ aB2DHomMatrixAndBColor.maB2DHomMatrix = maGradientInfo.getTextureTransform() *
+ basegfx::tools::createScaleTranslateB2DHomMatrix(0.5, 1.0 - (fStripeWidth * a), 0.5, 0.0);
aB2DHomMatrixAndBColor.maBColor = interpolate(maEnd, maStart, double(a) / double(maGradientInfo.getSteps() - 1));
-
rEntries.push_back(aB2DHomMatrixAndBColor);
}
}
@@ -285,17 +232,17 @@ namespace drawinglayer
namespace texture
{
GeoTexSvxGradientRadial::GeoTexSvxGradientRadial(
- const basegfx::B2DRange& rDefinitionRange,
+ const basegfx::B2DRange& rTargetRange,
const basegfx::BColor& rStart,
const basegfx::BColor& rEnd,
sal_uInt32 nSteps,
double fBorder,
double fOffsetX,
double fOffsetY)
- : GeoTexSvxGradient(rDefinitionRange, rStart, rEnd, nSteps, fBorder)
+ : GeoTexSvxGradient(rTargetRange, rStart, rEnd, nSteps, fBorder)
{
maGradientInfo = basegfx::tools::createRadialODFGradientInfo(
- rDefinitionRange,
+ rTargetRange,
basegfx::B2DVector(fOffsetX,fOffsetY),
nSteps,
fBorder);
@@ -307,9 +254,9 @@ namespace drawinglayer
void GeoTexSvxGradientRadial::appendTransformationsAndColors(
std::vector< B2DHomMatrixAndBColor >& rEntries,
- basegfx::BColor& rOuterColor)
+ basegfx::BColor& rOutmostColor)
{
- rOuterColor = maStart;
+ rOutmostColor = maStart;
if(maGradientInfo.getSteps())
{
@@ -342,7 +289,7 @@ namespace drawinglayer
namespace texture
{
GeoTexSvxGradientElliptical::GeoTexSvxGradientElliptical(
- const basegfx::B2DRange& rDefinitionRange,
+ const basegfx::B2DRange& rTargetRange,
const basegfx::BColor& rStart,
const basegfx::BColor& rEnd,
sal_uInt32 nSteps,
@@ -350,10 +297,10 @@ namespace drawinglayer
double fOffsetX,
double fOffsetY,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list