summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx')
-rw-r--r--sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index 50b2b9eb65f5..e82659ccd59f 100644
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
@@ -32,7 +32,9 @@
using namespace ::com::sun::star;
-using namespace objectpositioning;
+
+namespace objectpositioning
+{
/** constructor */
SwAsCharAnchoredObjectPosition::SwAsCharAnchoredObjectPosition(
@@ -50,9 +52,7 @@ SwAsCharAnchoredObjectPosition::SwAsCharAnchoredObjectPosition(
mnLineDescent( _nLineDescent ),
mnLineAscentInclObjs( _nLineAscentInclObjs ),
mnLineDescentInclObjs( _nLineDescentInclObjs ),
- maAnchorPos ( Point() ),
mnRelPos ( 0 ),
- maObjBoundRect ( SwRect() ),
mnLineAlignment ( sw::LineAlign::NONE )
{}
@@ -63,7 +63,7 @@ SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition()
/** method to cast <SwAnchoredObjectPosition::GetAnchorFrame()> to needed type */
const SwTextFrame& SwAsCharAnchoredObjectPosition::GetAnchorTextFrame() const
{
- OSL_ENSURE( dynamic_cast<const SwTextFrame*>( &GetAnchorFrame() ) != nullptr,
+ assert( dynamic_cast<const SwTextFrame*>( &GetAnchorFrame() ) &&
"SwAsCharAnchoredObjectPosition::GetAnchorTextFrame() - wrong anchor frame type" );
return static_cast<const SwTextFrame&>(GetAnchorFrame());
@@ -140,7 +140,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
// left difference is only considered, if requested.
if( !IsObjFly() )
{
- SwRect aSnapRect = GetObject().GetSnapRect();
+ SwRect aSnapRect(GetObject().GetSnapRect());
if ( rAnchorFrame.IsVertical() )
{
rAnchorFrame.SwitchVerticalToHorizontal( aSnapRect );
@@ -237,7 +237,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
// move drawing object to set its correct relative position.
{
- SwRect aSnapRect = GetObject().GetSnapRect();
+ SwRect aSnapRect(GetObject().GetSnapRect());
if ( rAnchorFrame.IsVertical() )
rAnchorFrame.SwitchVerticalToHorizontal( aSnapRect );
@@ -266,7 +266,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
rAnchorFrame.SwitchHorizontalToVertical( aAnchorPos );
// #i44347# - keep last object rectangle at anchored object
- OSL_ENSURE( dynamic_cast<const SwAnchoredDrawObject*>( &GetAnchoredObj() ) != nullptr,
+ assert( dynamic_cast<const SwAnchoredDrawObject*>( &GetAnchoredObj() ) &&
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong type of anchored object." );
SwAnchoredDrawObject& rAnchoredDrawObj =
static_cast<SwAnchoredDrawObject&>( GetAnchoredObj() );
@@ -293,7 +293,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
aRelAttr = Point( 0, nRelPos );
// OD 2004-03-23 #i26791#
- OSL_ENSURE( dynamic_cast<const SwFlyInContentFrame*>( &GetAnchoredObj()) != nullptr,
+ assert( dynamic_cast<const SwFlyInContentFrame*>( &GetAnchoredObj()) &&
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong anchored object." );
const SwFlyInContentFrame& rFlyInContentFrame =
static_cast<const SwFlyInContentFrame&>(GetAnchoredObj());
@@ -393,4 +393,6 @@ SwTwips SwAsCharAnchoredObjectPosition::GetRelPosToBase(
return nRelPosToBase;
}
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */