summaryrefslogtreecommitdiff
path: root/drawinglayer/source/geometry/viewinformation2d.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/geometry/viewinformation2d.cxx')
-rw-r--r--drawinglayer/source/geometry/viewinformation2d.cxx47
1 files changed, 47 insertions, 0 deletions
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx b/drawinglayer/source/geometry/viewinformation2d.cxx
index 7cb03954812a..f3f6dc7cc953 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -305,6 +305,22 @@ namespace drawinglayer
impInterpretPropertyValues(rViewParameters);
}
+ ImpViewInformation2D()
+ : mnRefCount(0),
+ maObjectTransformation(),
+ maViewTransformation(),
+ maObjectToViewTransformation(),
+ maInverseObjectToViewTransformation(),
+ maViewport(),
+ maDiscreteViewport(),
+ mxVisualizedPage(),
+ mfViewTime(),
+ mbReducedDisplayQuality(false),
+ mxViewInformation(),
+ mxExtendedInformation()
+ {
+ }
+
const basegfx::B2DHomMatrix& getObjectTransformation() const
{
return maObjectTransformation;
@@ -402,6 +418,21 @@ namespace drawinglayer
&& mfViewTime == rCandidate.mfViewTime
&& mxExtendedInformation == rCandidate.mxExtendedInformation);
}
+
+ static ImpViewInformation2D* get_global_default()
+ {
+ static ImpViewInformation2D* pDefault = 0;
+
+ if(!pDefault)
+ {
+ pDefault = new ImpViewInformation2D();
+
+ // never delete; start with RefCount 1, not 0
+ pDefault->mnRefCount++;
+ }
+
+ return pDefault;
+ }
};
} // end of anonymous namespace
} // end of namespace drawinglayer
@@ -434,6 +465,12 @@ namespace drawinglayer
{
}
+ ViewInformation2D::ViewInformation2D()
+ : mpViewInformation2D(ImpViewInformation2D::get_global_default())
+ {
+ mpViewInformation2D->mnRefCount++;
+ }
+
ViewInformation2D::ViewInformation2D(const ViewInformation2D& rCandidate)
: mpViewInformation2D(rCandidate.mpViewInformation2D)
{
@@ -455,6 +492,11 @@ namespace drawinglayer
}
}
+ bool ViewInformation2D::isDefault() const
+ {
+ return mpViewInformation2D == ImpViewInformation2D::get_global_default();
+ }
+
ViewInformation2D& ViewInformation2D::operator=(const ViewInformation2D& rCandidate)
{
::osl::Mutex m_mutex;
@@ -481,6 +523,11 @@ namespace drawinglayer
return true;
}
+ if(rCandidate.isDefault() != isDefault())
+ {
+ return false;
+ }
+
return (*rCandidate.mpViewInformation2D == *mpViewInformation2D);
}