summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-07-30 10:40:37 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-07-30 10:40:37 +0000
commit0ae578eaad7c0ffa16a6645debe0da30bf17ced3 (patch)
tree1f36f3dcce824104aa5058ccb525b7069f6a55d6 /svx/source
parent2882ddb948aa65f88031bba5905652862168723c (diff)
CWS-TOOLING: integrate CWS aw074_DEV300
2009-07-06 13:21:50 +0200 aw r273737 : CWS-TOOLING: rebase CWS aw074 to branches/OOO310@273700 (milestone: OOO310:m15) 2009-07-06 11:12:35 +0200 aw r273728 : #i102637# corrected condition to add gray frame to page visualisation objects 2009-07-03 14:43:00 +0200 aw r273702 : #i102380# always swap n GrafObjects on MasterPages synchronously 2009-07-03 12:14:57 +0200 aw r273686 : #i102548# corrected SdrPathPrimitive2D's usage of unit polygon 2009-07-02 16:06:16 +0200 aw r273662 : #i103255# added control when to show the draft graphic visualisation (in VOC, of course) and when not. Changed text visualisation to BlockText 2009-07-01 17:36:55 +0200 aw r273609 : #i103116# clear GaphicLink for interaction clone of graphic objets 2009-07-01 16:42:09 +0200 aw r273601 : #i101491# corrected some minor glitches in line geometry creation 2009-06-30 18:47:44 +0200 aw r273532 : #i102380# committed the cleanups/additions for the fix 2009-06-26 13:16:17 +0200 aw r273404 : #i101491# finetuning changes 2009-06-26 13:15:57 +0200 aw r273403 : #i101491# finetuning changes 2009-06-25 16:31:26 +0200 aw r273387 : #i101491# first version checkin for linux/mac tests 2009-06-25 16:31:04 +0200 aw r273386 : #i101491# first version checkin for linux/mac tests 2009-06-24 15:35:05 +0200 aw r273350 : #i101734# corrected VclMetafileProcessor2D::impTryToCreateSvtGraphicStroke to use the current ObjectTransformation 2009-06-24 15:01:58 +0200 aw r273348 : #i101811# added ViewInformation2D to renderChartPrimitive2D to allow embedding of object transformation to target MapMode 2009-06-24 12:27:05 +0200 aw r273328 : #i101980# use a hairline LineWitdth for SdrObject::TakeContour() calculation (like the old implementation did) 2009-06-24 11:29:43 +0200 aw r273321 : #i101781# corrected creation fallback for FullDrag for circle objects 2009-06-23 17:26:58 +0200 aw r273300 : #i101556# made primitive text attributes take versioned base text attribute sets into account
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/outliner/outliner.cxx2
-rw-r--r--svx/source/sdr/attribute/sdrtextattribute.cxx8
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx335
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrpathobj.cxx119
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofgraphic.cxx29
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofpageobj.cxx3
-rw-r--r--svx/source/sdr/properties/properties.cxx5
-rw-r--r--svx/source/sdr/properties/textproperties.cxx23
-rw-r--r--svx/source/svdraw/svdcrtv.cxx14
-rw-r--r--svx/source/svdraw/svdobj.cxx5
-rw-r--r--svx/source/svdraw/svdograf.cxx25
11 files changed, 459 insertions, 109 deletions
diff --git a/svx/source/outliner/outliner.cxx b/svx/source/outliner/outliner.cxx
index 106f30c6af..f290864808 100644
--- a/svx/source/outliner/outliner.cxx
+++ b/svx/source/outliner/outliner.cxx
@@ -1526,7 +1526,7 @@ void Outliner::ImplCheckParagraphs( USHORT nStart, USHORT nEnd )
if (pPara)
{
pPara->Invalidate();
- ImplCalcBulletText( static_cast< USHORT >(n), FALSE, FALSE );
+ ImplCalcBulletText( n, FALSE, FALSE );
}
}
}
diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx
index 93661e2477..09f5299654 100644
--- a/svx/source/sdr/attribute/sdrtextattribute.cxx
+++ b/svx/source/sdr/attribute/sdrtextattribute.cxx
@@ -37,6 +37,7 @@
#include <svx/outlobj.hxx>
#include <svx/editobj.hxx>
#include <svx/flditem.hxx>
+#include <svx/sdr/properties/properties.hxx>
//////////////////////////////////////////////////////////////////////////////
// pointer compare define
@@ -69,6 +70,7 @@ namespace drawinglayer
maTextUpperDistance(aTextUpperDistance),
maTextRightDistance(aTextRightDistance),
maTextLowerDistance(aTextLowerDistance),
+ maPropertiesVersion(0),
mbContour(bContour),
mbFitToSize(bFitToSize),
mbHideContour(bHideContour),
@@ -82,6 +84,11 @@ namespace drawinglayer
const SfxItemSet& rSet = getSdrText().GetItemSet();
mpSdrFormTextAttribute = new SdrFormTextAttribute(rSet);
}
+
+ // #i101556# init with version number to detect changes of single text
+ // attribute and/or style sheets in primitive data without having to
+ // copy that data locally (which would be better from principle)
+ maPropertiesVersion = rSdrText.GetObject().GetProperties().getVersion();
}
SdrTextAttribute::~SdrTextAttribute()
@@ -158,6 +165,7 @@ namespace drawinglayer
&& getTextUpperDistance() == rCandidate.getTextUpperDistance()
&& getTextRightDistance() == rCandidate.getTextRightDistance()
&& getTextLowerDistance() == rCandidate.getTextLowerDistance()
+ && getPropertiesVersion() == rCandidate.getPropertiesVersion()
&& isContour() == rCandidate.isContour()
&& isFitToSize() == rCandidate.isFitToSize()
&& isHideContour() == rCandidate.isHideContour()
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index 3f6ac13caf..40f005dd5c 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -53,6 +53,18 @@
#include <svdglob.hxx>
#include <vcl/svapp.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/bitmapprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
+#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+
+#include <svx/sdr/primitive2d/sdrtextprimitive2d.hxx>
+#include <svx/eeitem.hxx>
+#include <svx/colritem.hxx>
+//#include <svx/xtable.hxx>
+
//////////////////////////////////////////////////////////////////////////////
namespace sdr
@@ -78,6 +90,238 @@ namespace sdr
{
}
+ void ViewContactOfGraphic::flushGraphicObjects()
+ {
+ // #i102380# The graphic is swapped out. To let that have an effect ist is necessary to
+ // delete copies of the GraphicObject which are not swapped out and have no SwapHandler set
+ // (this is what happnes when the GraphicObject gets copied to a SdrGrafPrimitive2D). This
+ // is best achieved for the VC by clearing the local decomposition cache. It would be possible
+ // to also do this for the VOC cache, but that VOCs exist exactly expresss that the object
+ // gets visualised, so this would be wrong.
+ flushViewIndependentPrimitive2DSequence();
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForPresObj(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute,
+ const GraphicAttr& rLocalGrafInfo) const
+ {
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ GraphicObject aEmptyGraphicObject;
+ GraphicAttr aEmptyGraphicAttr;
+
+ // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ rObjectMatrix,
+ rAttribute,
+ aEmptyGraphicObject,
+ aEmptyGraphicAttr));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
+
+ // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and
+ // without attributes
+ basegfx::B2DHomMatrix aSmallerMatrix;
+
+ // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
+ // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
+ // safe to assume 100th mm as target.
+ Size aPrefSize(GetGrafObject().GetGrafPrefSize());
+
+ if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM);
+ }
+
+ // decompose object matrix to get single values
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0);
+ const double fOffsetY((aScale.getY() - aPrefSize.getHeight()) / 2.0);
+
+ if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
+ {
+ // create the EmptyPresObj fallback visualisation. The fallback graphic
+ // is already provided in rGraphicObject in this case, use it
+ aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
+ aSmallerMatrix.translate(fOffsetX, fOffsetY);
+ aSmallerMatrix.shearX(fShearX);
+ aSmallerMatrix.rotate(fRotate);
+ aSmallerMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ aSmallerMatrix,
+ aEmptyAttributes,
+ rGraphicObject,
+ rLocalGrafInfo));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
+ }
+
+ return xRetval;
+ }
+
+ drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createVIP2DSForDraft(
+ const basegfx::B2DHomMatrix& rObjectMatrix,
+ const drawinglayer::attribute::SdrLineFillShadowTextAttribute& rAttribute) const
+ {
+ drawinglayer::primitive2d::Primitive2DSequence xRetval;
+ GraphicObject aEmptyGraphicObject;
+ GraphicAttr aEmptyGraphicAttr;
+
+ // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
+ const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
+ rObjectMatrix,
+ rAttribute,
+ aEmptyGraphicObject,
+ aEmptyGraphicAttr));
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
+
+ if(!rAttribute.getLine())
+ {
+ // create a surrounding frame when no linestyle given
+ const Color aColor(Application::GetSettings().GetStyleSettings().GetShadowColor());
+ const basegfx::BColor aBColor(aColor.getBColor());
+ const basegfx::B2DRange aUnitRange(0.0, 0.0, 1.0, 1.0);
+
+ basegfx::B2DPolygon aOutline(basegfx::tools::createPolygonFromRect(aUnitRange));
+ aOutline.transform(rObjectMatrix);
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aOutline,
+ aBColor)));
+ }
+
+ // decompose object matrix to get single values
+ basegfx::B2DVector aScale, aTranslate;
+ double fRotate, fShearX;
+ rObjectMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+
+ // define a distance value, used for distance from bitmap to borders and from bitmap
+ // to text, too (2 mm)
+ const double fDistance(200.0);
+
+ // consume borders from values
+ aScale.setX(std::max(0.0, aScale.getX() - (2.0 * fDistance)));
+ aScale.setY(std::max(0.0, aScale.getY() - (2.0 * fDistance)));
+ aTranslate.setX(aTranslate.getX() + fDistance);
+ aTranslate.setY(aTranslate.getY() + fDistance);
+
+ // draw a draft bitmap
+ const Bitmap aDraftBitmap(ResId(BMAP_GrafikEi, *ImpGetResMgr()));
+
+ if(!aDraftBitmap.IsEmpty())
+ {
+ Size aPrefSize(aDraftBitmap.GetPrefSize());
+
+ if(MAP_PIXEL == aDraftBitmap.GetPrefMapMode().GetMapUnit())
+ {
+ aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MAP_100TH_MM);
+ }
+ else
+ {
+ aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MAP_100TH_MM);
+ }
+
+ const double fBitmapScaling(2.0);
+ const double fWidth(aPrefSize.getWidth() * fBitmapScaling);
+ const double fHeight(aPrefSize.getHeight() * fBitmapScaling);
+
+ if(basegfx::fTools::more(fWidth, 1.0)
+ && basegfx::fTools::more(fHeight, 1.0)
+ && basegfx::fTools::lessOrEqual(fWidth, aScale.getX())
+ && basegfx::fTools::lessOrEqual(fHeight, aScale.getY()))
+ {
+ basegfx::B2DHomMatrix aBitmapMatrix;
+
+ aBitmapMatrix.scale(fWidth, fHeight);
+ aBitmapMatrix.shearX(fShearX);
+ aBitmapMatrix.rotate(fRotate);
+ aBitmapMatrix.translate(aTranslate.getX(), aTranslate.getY());
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval,
+ drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::BitmapPrimitive2D(
+ BitmapEx(aDraftBitmap),
+ aBitmapMatrix)));
+
+ // consume bitmap size in X
+ aScale.setX(std::max(0.0, aScale.getX() - (fWidth + fDistance)));
+ aTranslate.setX(aTranslate.getX() + fWidth + fDistance);
+ }
+ }
+
+ // Build the text for the draft object
+ XubString aDraftText = GetGrafObject().GetFileName();
+
+ if(!aDraftText.Len())
+ {
+ aDraftText = GetGrafObject().GetName();
+ aDraftText.AppendAscii(" ...");
+ }
+
+ if(aDraftText.Len() && GetGrafObject().GetModel())
+ {
+ // #i103255# Goal is to produce TextPrimitives which hold the given text as
+ // BlockText in the available space. It would be very tricky to do
+ // an own word wrap/line layout here.
+ // Using SdrBlockTextPrimitive2D OTOH is critical since it internally
+ // uses the SdrObject it references. To solve this, create a temp
+ // SdrObject with Attributes and Text, generate a SdrBlockTextPrimitive2D
+ // directly and immediately decompose it. After that, it is no longer
+ // needed and can be deleted.
+
+ // create temp RectObj as TextObj and set needed attributes
+ SdrRectObj aRectObj(OBJ_TEXT);
+ aRectObj.SetModel(GetGrafObject().GetModel());
+ aRectObj.NbcSetText(aDraftText);
+ aRectObj.SetMergedItem(SvxColorItem(Color(COL_LIGHTRED), EE_CHAR_COLOR));
+
+ // get SdrText and OPO
+ SdrText* pSdrText = aRectObj.getText(0);
+ OutlinerParaObject* pOPO = aRectObj.GetOutlinerParaObject();
+
+ if(pSdrText && pOPO)
+ {
+ // directly use the remaining space as TextRangeTransform
+ basegfx::B2DHomMatrix aTextRangeTransform;
+
+ aTextRangeTransform.scale(aScale.getX(), aScale.getY());
+ aTextRangeTransform.shearX(fShearX);
+ aTextRangeTransform.rotate(fRotate);
+ aTextRangeTransform.translate(aTranslate.getX(), aTranslate.getY());
+
+ // directly create temp SdrBlockTextPrimitive2D
+ drawinglayer::primitive2d::SdrBlockTextPrimitive2D aBlockTextPrimitive(
+ *pSdrText,
+ *pOPO,
+ aTextRangeTransform,
+ false,
+ false,
+ false);
+
+ // decompose immediately with neutral ViewInformation. This will
+ // layout the text to more simple TextPrimitives from drawinglayer
+ const drawinglayer::geometry::ViewInformation2D aViewInformation2D(0);
+
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(
+ xRetval,
+ aBlockTextPrimitive.get2DDecomposition(aViewInformation2D));
+ }
+ }
+
+ return xRetval;
+ }
+
drawinglayer::primitive2d::Primitive2DSequence ViewContactOfGraphic::createViewIndependentPrimitive2DSequence() const
{
drawinglayer::primitive2d::Primitive2DSequence xRetval;
@@ -86,7 +330,8 @@ namespace sdr
if(pSdrText)
{
const SfxItemSet& rItemSet = GetGrafObject().GetMergedItemSet();
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
bool bVisible(pAttribute && pAttribute->isVisible());
// create and fill GraphicAttr
@@ -131,7 +376,7 @@ namespace sdr
// which will use the primitive data we just create in the near future
const Rectangle& rRectangle = GetGrafObject().GetGeoRect();
const ::basegfx::B2DRange aObjectRange(rRectangle.Left(), rRectangle.Top(), rRectangle.Right(), rRectangle.Bottom());
- ::basegfx::B2DHomMatrix aObjectMatrix;
+ basegfx::B2DHomMatrix aObjectMatrix;
// look for mirroring
const GeoStat& rGeoStat(GetGrafObject().GetGeoStat());
@@ -170,60 +415,25 @@ namespace sdr
// get the current, unchenged graphic obect from SdrGrafObj
const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
- if(GetGrafObject().IsEmptyPresObj())
+ if(visualisationUsesPresObj())
{
// it's an EmptyPresObj, create the SdrGrafPrimitive2D without content and another scaled one
// with the content which is the placeholder graphic
- GraphicObject aEmptyGraphicObject;
- GraphicAttr aEmptyGraphicAttr;
- drawinglayer::attribute::SdrLineFillShadowTextAttribute aEmptyAttributes(0, 0, 0, 0, 0, 0);
-
- // SdrGrafPrimitive2D without content in original size which carries all eventual attributes and texts
- const drawinglayer::primitive2d::Primitive2DReference xReferenceA(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aObjectMatrix, *pAttribute, aEmptyGraphicObject, aEmptyGraphicAttr));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReferenceA, 1);
-
- // SdrGrafPrimitive2D with content (which is the preview graphic) scaled to smaller size and
- // without attributes
- basegfx::B2DHomMatrix aSmallerMatrix;
-
- // #i94431# for some reason, i forgot to take the PrefMapMode of the graphic
- // into account. Since EmptyPresObj's are only used in Draw/Impress, it is
- // safe to assume 100th mm as target.
- Size aPrefSize(GetGrafObject().GetGrafPrefSize());
-
- if(MAP_PIXEL == GetGrafObject().GetGrafPrefMapMode().GetMapUnit())
- {
- aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MAP_100TH_MM);
- }
- else
- {
- aPrefSize = Application::GetDefaultDevice()->LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MAP_100TH_MM);
- }
-
- const double fOffsetX((aObjectRange.getWidth() - aPrefSize.getWidth()) / 2.0);
- const double fOffsetY((aObjectRange.getHeight() - aPrefSize.getHeight()) / 2.0);
-
- if(basegfx::fTools::moreOrEqual(fOffsetX, 0.0) && basegfx::fTools::moreOrEqual(fOffsetY, 0.0))
- {
- aSmallerMatrix.scale(aPrefSize.getWidth(), aPrefSize.getHeight());
- aSmallerMatrix.translate(fOffsetX, fOffsetY);
- aSmallerMatrix.shearX(fShearX);
- aSmallerMatrix.rotate(fRotate);
- aSmallerMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- const drawinglayer::primitive2d::Primitive2DReference xReferenceB(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
- aSmallerMatrix,
- aEmptyAttributes,
- rGraphicObject,
- aLocalGrafInfo));
-
- drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(xRetval, xReferenceB);
- }
+ xRetval = createVIP2DSForPresObj(aObjectMatrix, *pAttribute, aLocalGrafInfo);
+ }
+ else if(visualisationUsesDraft())
+ {
+ // #i102380# The graphic is swapped out. To not force a swap-in here, there is a mechanism
+ // which shows a swapped-out-visualisation (which gets created here now) and an asynchronious
+ // visual update mechanism for swapped-out grapgics when they were loaded (see AsynchGraphicLoadingEvent
+ // and ViewObjectContactOfGraphic implementation). Not forcing the swap-in here allows faster
+ // (non-blocking) processing here and thus in the effect e.g. fast scrolling through pages
+ xRetval = createVIP2DSForDraft(aObjectMatrix, *pAttribute);
}
else
{
- // create primitive
+ // create primitive. Info: Calling the copy-constructor of GraphicObject in this
+ // SdrGrafPrimitive2D constructor will force a full swap-in of the graphic
const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::SdrGrafPrimitive2D(
aObjectMatrix,
*pAttribute,
@@ -241,6 +451,31 @@ namespace sdr
return xRetval;
}
+ bool ViewContactOfGraphic::visualisationUsesPresObj() const
+ {
+ return GetGrafObject().IsEmptyPresObj();
+ }
+
+ bool ViewContactOfGraphic::visualisationUsesDraft() const
+ {
+ // no draft when already PresObj
+ if(visualisationUsesPresObj())
+ return false;
+
+ // draft when swapped out
+ const GraphicObject& rGraphicObject = GetGrafObject().GetGraphicObject(false);
+ static bool bAllowReplacements(true);
+
+ if(rGraphicObject.IsSwappedOut() && bAllowReplacements)
+ return true;
+
+ // draft when no graphic
+ if(GRAPHIC_NONE == rGraphicObject.GetType() || GRAPHIC_DEFAULT == rGraphicObject.GetType())
+ return true;
+
+ return false;
+ }
+
} // end of namespace contact
} // end of namespace sdr
diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index da467f8c63..1cb99de835 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -62,59 +62,86 @@ namespace sdr
if(pSdrText)
{
- drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute = drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(rItemSet, *pSdrText);
+ drawinglayer::attribute::SdrLineFillShadowTextAttribute* pAttribute =
+ drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute(
+ rItemSet,
+ *pSdrText);
if(pAttribute)
{
if(pAttribute->isVisible())
{
- // prepare object transformation and unit polygon (direct model data)
- ::basegfx::B2DHomMatrix aObjectMatrix;
- ::basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
- const bool bIsLine(
- !aUnitPolyPolygon.areControlPointsUsed()
- && 1L == aUnitPolyPolygon.count()
- && 2L == aUnitPolyPolygon.getB2DPolygon(0L).count());
-
- if(bIsLine)
- {
- // special handling for single line mode (2 points)
- const ::basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0L));
- const ::basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0L));
- const ::basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1L));
- const ::basegfx::B2DVector aLine(aEnd - aStart);
-
- // create new polygon
- ::basegfx::B2DPolygon aNewPolygon;
- aNewPolygon.append(::basegfx::B2DPoint(0.0, 0.0));
- aNewPolygon.append(::basegfx::B2DPoint(aLine.getLength(), 0.0));
- aUnitPolyPolygon.setB2DPolygon(0L, aNewPolygon);
-
- // fill objectMatrix with rotation and offset (no shear for lines, scale in polygon)
- aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX()));
- aObjectMatrix.translate(aStart.getX(), aStart.getY());
- }
- else
+ basegfx::B2DPolyPolygon aUnitPolyPolygon(GetPathObj().GetPathPoly());
+ const sal_uInt32 nPolyCount(aUnitPolyPolygon.count());
+
+ if(nPolyCount)
{
- // create scaled, but unsheared, unrotated and untranslated polygon
- // by creating the object matrix and back-transforming the polygon
- const ::basegfx::B2DRange aObjectRange(::basegfx::tools::getRange(aUnitPolyPolygon));
- const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
-
- aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
- aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
- aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
-
- // ceate scaled unit polygon from object's absolute path
- ::basegfx::B2DHomMatrix aInverse(aObjectMatrix);
- aInverse.invert();
- aUnitPolyPolygon.transform(aInverse);
+ // prepare object transformation and unit polygon (direct model data)
+ basegfx::B2DHomMatrix aObjectMatrix;
+ const bool bIsLine(
+ !aUnitPolyPolygon.areControlPointsUsed()
+ && 1 == nPolyCount
+ && 2 == aUnitPolyPolygon.getB2DPolygon(0).count());
+
+ if(bIsLine)
+ {
+ // special handling for single line mode (2 points)
+ const basegfx::B2DPolygon aSubPolygon(aUnitPolyPolygon.getB2DPolygon(0));
+ const basegfx::B2DPoint aStart(aSubPolygon.getB2DPoint(0));
+ const basegfx::B2DPoint aEnd(aSubPolygon.getB2DPoint(1));
+ const basegfx::B2DVector aLine(aEnd - aStart);
+
+ // #i102548# create new unit polygon for line (horizontal)
+ basegfx::B2DPolygon aNewPolygon;
+ aNewPolygon.append(basegfx::B2DPoint(0.0, 0.0));
+ aNewPolygon.append(basegfx::B2DPoint(1.0, 0.0));
+ aUnitPolyPolygon.setB2DPolygon(0, aNewPolygon);
+
+ // #i102548# fill objectMatrix with rotation and offset (no shear for lines)
+ aObjectMatrix.scale(aLine.getLength(), 1.0);
+ aObjectMatrix.rotate(atan2(aLine.getY(), aLine.getX()));
+ aObjectMatrix.translate(aStart.getX(), aStart.getY());
+ }
+ else
+ {
+ // #i102548# create unscaled, unsheared, unrotated and untranslated polygon
+ // (unit polygon) by creating the object matrix and back-transforming the polygon
+ const basegfx::B2DRange aObjectRange(basegfx::tools::getRange(aUnitPolyPolygon));
+ const GeoStat& rGeoStat(GetPathObj().GetGeoStat());
+ const double fWidth(aObjectRange.getWidth());
+ const double fHeight(aObjectRange.getHeight());
+
+ aObjectMatrix.scale(
+ basegfx::fTools::equalZero(fWidth) ? 1.0 : fWidth,
+ basegfx::fTools::equalZero(fHeight) ? 1.0 : fHeight);
+
+ if(rGeoStat.nShearWink)
+ {
+ aObjectMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000));
+ }
+
+ if(rGeoStat.nDrehWink)
+ {
+ aObjectMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000);
+ }
+
+ aObjectMatrix.translate(aObjectRange.getMinX(), aObjectRange.getMinY());
+
+ // ceate unit polygon from object's absolute path
+ basegfx::B2DHomMatrix aInverse(aObjectMatrix);
+ aInverse.invert();
+ aUnitPolyPolygon.transform(aInverse);
+ }
+
+ // create primitive
+ const drawinglayer::primitive2d::Primitive2DReference xReference(
+ new drawinglayer::primitive2d::SdrPathPrimitive2D(
+ aObjectMatrix,
+ *pAttribute,
+ aUnitPolyPolygon));
+
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
-
- // create primitive
- const drawinglayer::primitive2d::Primitive2DReference xReference(
- new drawinglayer::primitive2d::SdrPathPrimitive2D(aObjectMatrix, *pAttribute, aUnitPolyPolygon));
- xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
}
delete pAttribute;
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 7a6e115490..4b3f2b6244 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -38,6 +38,7 @@
#include <svx/svdograf.hxx>
#include <svx/sdr/contact/objectcontact.hxx>
#include <svx/svdmodel.hxx>
+#include <svx/svdpage.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -245,10 +246,19 @@ namespace sdr
{
// prepare primitive generation with evtl. loading the graphic when it's swapped out
SdrGrafObj& rGrafObj = const_cast< ViewObjectContactOfGraphic* >(this)->getSdrGrafObj();
- const bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
+ bool bDoAsynchronGraphicLoading(rGrafObj.GetModel() && rGrafObj.GetModel()->IsSwapGraphics());
static bool bSuppressAsynchLoading(false);
bool bSwapInDone(false);
+ if(bDoAsynchronGraphicLoading
+ && rGrafObj.IsSwappedOut()
+ && rGrafObj.GetPage()
+ && rGrafObj.GetPage()->IsMasterPage())
+ {
+ // #i102380# force Swap-In for GraphicObjects on MasterPage to have a nicer visualisation
+ bDoAsynchronGraphicLoading = false;
+ }
+
if(bDoAsynchronGraphicLoading && !bSuppressAsynchLoading)
{
bSwapInDone = const_cast< ViewObjectContactOfGraphic* >(this)->impPrepareGraphicWithAsynchroniousLoading();
@@ -261,6 +271,23 @@ namespace sdr
// get return value by calling parent
drawinglayer::primitive2d::Primitive2DSequence xRetval = ViewObjectContactOfSdrObj::createPrimitive2DSequence(rDisplayInfo);
+ if(xRetval.hasElements())
+ {
+ // #i103255# suppress when graphic needs draft visualisation and output
+ // is for PDF export/Printer
+ const ViewContactOfGraphic& rVCOfGraphic = static_cast< const ViewContactOfGraphic& >(GetViewContact());
+
+ if(rVCOfGraphic.visualisationUsesDraft())
+ {
+ const ObjectContact& rObjectContact = GetObjectContact();
+
+ if(rObjectContact.isOutputToPDFFile() || rObjectContact.isOutputToPrinter())
+ {
+ xRetval = drawinglayer::primitive2d::Primitive2DSequence();
+ }
+ }
+ }
+
// if swap in was forced only for printing, swap out again
const bool bSwapInExclusiveForPrinting(bSwapInDone && GetObjectContact().isOutputToPrinter());
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index f69f4d5550..87ba0b8c3a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -291,7 +291,8 @@ namespace sdr
}
// add a gray outline frame, except not when printing
- if(!GetObjectContact().isOutputToPrinter())
+ // #i102637# add frame also when printing and page exists (handout pages)
+ if(!GetObjectContact().isOutputToPrinter() || pPage)
{
const Color aFrameColor(aColorConfig.GetColorValue(svtools::OBJECTBOUNDARIES).nColor);
basegfx::B2DPolygon aOwnOutline(basegfx::tools::createPolygonFromRect(basegfx::B2DRange(0.0, 0.0, 1.0, 1.0)));
diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx
index 0d6cb3b83b..fe317a495a 100644
--- a/svx/source/sdr/properties/properties.cxx
+++ b/svx/source/sdr/properties/properties.cxx
@@ -180,6 +180,11 @@ namespace sdr
GetSdrObject().SendUserCall(SDRUSERCALL_CHGATTR, rChange.GetRectangle(a));
}
}
+
+ sal_uInt32 BaseProperties::getVersion() const
+ {
+ return 0;
+ }
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx
index 139d2fb988..229ba89db5 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -72,12 +72,14 @@ namespace sdr
}
TextProperties::TextProperties(SdrObject& rObj)
- : AttributeProperties(rObj)
+ : AttributeProperties(rObj),
+ maVersion(0)
{
}
TextProperties::TextProperties(const TextProperties& rProps, SdrObject& rObj)
- : AttributeProperties(rProps, rObj)
+ : AttributeProperties(rProps, rObj),
+ maVersion(rProps.getVersion())
{
}
@@ -93,10 +95,11 @@ namespace sdr
void TextProperties::ItemSetChanged(const SfxItemSet& rSet)
{
SdrTextObj& rObj = (SdrTextObj&)GetSdrObject();
-
-
sal_Int32 nText = rObj.getTextCount();
+ // #i101556# ItemSet has changed -> new version
+ maVersion++;
+
while( --nText >= 0 )
{
SdrText* pText = rObj.getText( nText );
@@ -237,6 +240,9 @@ namespace sdr
// call parent
AttributeProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ // #i101556# StyleSheet has changed -> new version
+ maVersion++;
+
if( rObj.GetModel() /*&& !rObj.IsTextEditActive()*/ && !rObj.IsLinkedText() )
{
SdrOutliner& rOutliner = rObj.ImpGetDrawOutliner();
@@ -577,6 +583,9 @@ namespace sdr
rObj.ActionChanged();
//rObj.BroadcastObjectChange();
}
+
+ // #i101556# content of StyleSheet has changed -> new version
+ maVersion++;
}
if(SFX_HINT_DYING == nId)
@@ -616,6 +625,12 @@ namespace sdr
}
}
}
+
+ // #i101556# Handout version information
+ sal_uInt32 TextProperties::getVersion() const
+ {
+ return maVersion;
+ }
} // end of namespace properties
} // end of namespace sdr
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index cc8f62082e..54cb04d980 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -824,13 +824,15 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, BOOL bFull*/)
}
}
- // #i68562# Force to non-solid dragging when not creating a full circle and up to step three
- if(bUseSolidDragging
- && pAktCreate->ISA(SdrCircObj)
- && OBJ_CIRC != (SdrObjKind)(static_cast< SdrCircObj* >(pAktCreate)->GetObjIdentifier())
- && aDragStat.GetPointAnz() < 4L)
+ // #i101781# force to non-solid dragging when not creating a full circle
+ if(bUseSolidDragging)
{
- bUseSolidDragging = false;
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(pAktCreate);
+
+ if(pCircObj && OBJ_CIRC != pCircObj->GetObjIdentifier())
+ {
+ bUseSolidDragging = false;
+ }
}
if(bUseSolidDragging)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 507b86f2c5..d11b31789d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1165,6 +1165,11 @@ basegfx::B2DPolyPolygon SdrObject::TakeContour() const
SfxItemSet aNewSet(*GetObjectItemPool());
+ // #i101980# ignore LineWidth; that's what the old implementation
+ // did. With linewidth, the result may be huge due to fat/thick
+ // line decompositions
+ aNewSet.Put(XLineWidthItem(0));
+
// solid black lines and no fill
aNewSet.Put(XLineStyleItem(XLINE_SOLID));
aNewSet.Put(XLineColorItem(String(), Color(COL_BLACK)));
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 3898f2536c..67d02ac706 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -659,6 +659,23 @@ void SdrGrafObj::TakeObjNamePlural( XubString& rName ) const
// -----------------------------------------------------------------------------
+SdrObject* SdrGrafObj::getFullDragClone() const
+{
+ // call parent
+ SdrGrafObj* pRetval = static_cast< SdrGrafObj* >(SdrRectObj::getFullDragClone());
+
+ // #i103116# the full drag clone leads to problems
+ // with linked graphics, so reset the link in this
+ // temporary interaction object and load graphic
+ if(pRetval && IsLinkedGraphic())
+ {
+ pRetval->ForceSwapIn();
+ pRetval->ReleaseGraphicLink();
+ }
+
+ return pRetval;
+}
+
void SdrGrafObj::operator=( const SdrObject& rObj )
{
SdrRectObj::operator=( rObj );
@@ -1090,6 +1107,14 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO )
pRet = GRFMGR_AUTOSWAPSTREAM_TEMP;
pGraphic->SetUserData();
}
+
+ // #i102380#
+ sdr::contact::ViewContactOfGraphic* pVC = dynamic_cast< sdr::contact::ViewContactOfGraphic* >(&GetViewContact());
+
+ if(pVC)
+ {
+ pVC->flushGraphicObjects();
+ }
}
}
}