sw/source/core/objectpositioning/anchoredobjectposition.cxx         |    6 
+++++-
 sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx   |    6 
+++++-
 sw/source/core/objectpositioning/environmentofanchoredobject.cxx    |    5 
++++-
 sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx  |    4 +++-
 sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx |    5 
++++-
 5 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit 0a78f4dfb7889c3d4807c9320bc21d3d4f8dec6e
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Wed Jan 26 20:21:15 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Jan 27 08:17:24 2022 +0100

    sw: remove confusing 'using namespace objectpositioning' statements
    
    The using namespace declaration implicitly put the
    SwAnchoredObjectPosition definition into that namespace, but this is far
    from obvious when reading the code.
    
    Just put the definitions into the namespace, the way other code in sw/
    does this.
    
    Change-Id: I580c6bc5bb46a76364ddeeca021dd7b0e4369e42
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129007
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index f8b153217455..e530e36df365 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -40,7 +40,9 @@
 #include <osl/diagnose.h>
 
 using namespace ::com::sun::star;
-using namespace objectpositioning;
+
+namespace objectpositioning
+{
 
 SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj )
     : mrDrawObj( _rDrawObj ),
@@ -1139,4 +1141,6 @@ bool SwAnchoredObjectPosition::Minor_( sal_Int16 
_eRelOrient1,
     return bRetVal;
 }
 
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index b78cadaf1549..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(
@@ -391,4 +393,6 @@ SwTwips SwAsCharAnchoredObjectPosition::GetRelPosToBase(
     return nRelPosToBase;
 }
 
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx 
b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
index 79cb7b14eef3..9588e2b4ac2d 100644
--- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
+++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx
@@ -22,7 +22,8 @@
 #include <pagefrm.hxx>
 #include <osl/diagnose.h>
 
-using namespace objectpositioning;
+namespace objectpositioning
+{
 
 SwEnvironmentOfAnchoredObject::SwEnvironmentOfAnchoredObject(
                                                 const bool   _bFollowTextFlow )
@@ -96,4 +97,6 @@ const SwLayoutFrame& 
SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFram
     return static_cast<const SwLayoutFrame&>(*pVertEnvironmentLayFrame);
 }
 
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index a5ea2bf7e43f..700b737b1689 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -42,9 +42,10 @@
 #include <sortedobjs.hxx>
 #include <textboxhelper.hxx>
 
-using namespace objectpositioning;
 using namespace ::com::sun::star;
 
+namespace objectpositioning
+{
 SwToContentAnchoredObjectPosition::SwToContentAnchoredObjectPosition( 
SdrObject& _rDrawObj )
     : SwAnchoredObjectPosition ( _rDrawObj ),
       mpVertPosOrientFrame( nullptr ),
@@ -1211,5 +1212,6 @@ const SwFrame& 
SwToContentAnchoredObjectPosition::GetHoriVirtualAnchor(
     return *pHoriVirtAnchFrame;
 }
 
+}
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git 
a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx 
b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 371a3b0536a1..3e7d98bf7aaa 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -33,9 +33,10 @@
 #include <editeng/lrspitem.hxx>
 #include <editeng/ulspitem.hxx>
 
-using namespace objectpositioning;
 using namespace ::com::sun::star;
 
+namespace objectpositioning
+{
 SwToLayoutAnchoredObjectPosition::SwToLayoutAnchoredObjectPosition( SdrObject& 
_rDrawObj )
     : SwAnchoredObjectPosition( _rDrawObj )
 {}
@@ -220,4 +221,6 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
     maRelPos = aRelPos;
 }
 
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to