[Libreoffice-commits] core.git: sfx2/source

Rohan Kumar rohankanojia420 at gmail.com
Tue Apr 12 11:50:47 UTC 2016


 sfx2/source/doc/Metadatable.cxx |    2 +-
 sfx2/source/doc/objmisc.cxx     |   38 +++++++++++++-------------------------
 2 files changed, 14 insertions(+), 26 deletions(-)

New commits:
commit 77ba9d7e3055d69667e6c3545f311492a34056c6
Author: Rohan Kumar <rohankanojia420 at gmail.com>
Date:   Fri Apr 8 11:56:21 2016 +0530

    tdf#91794 remove OSL_DEBUG_LEVEL > 1 conditionals
    
    I replaced OSL_DEBUG_LEVEL > 1 to OSL_DEBUG_LEVEL > 0 conditionals
    as suggested in easyhack. I didn't convert those fprintf statements
    because they were required for debug output formatting according to me
    
    Change-Id: I54d5b0873f527fd04d736eeb01d18f73eb9be74f
    Reviewed-on: https://gerrit.libreoffice.org/23069
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Björn Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index 229659b..9892e49 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -1639,7 +1639,7 @@ throw (uno::RuntimeException, std::exception)
 } // namespace sfx2
 
 
-#if OSL_DEBUG_LEVEL > 1
+#if OSL_DEBUG_LEVEL > 0
 
 #include <stdio.h>
 
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 6a04de2..a48f6df 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -725,17 +725,6 @@ void SfxObjectShell::SetTitle
 }
 
 
-#if OSL_DEBUG_LEVEL > 1
-OUString X(const OUString &rRet)
-{
-    if ( rRet.isEmpty() )
-        return OUString( "-empty-" );
-    return rRet;
-}
-#else
-#define X(ret) ret
-#endif
-
 
 OUString SfxObjectShell::GetTitle
 (
@@ -818,15 +807,15 @@ OUString SfxObjectShell::GetTitle
         if ( IsTemplate() )
             pThis->SetTitle( aTitle );
         bRecur = false;
-        return X(aTitle);
+        return aTitle;
     }
     else if (SFX_TITLE_APINAME == nMaxLength )
-        return X(GetAPIName());
+        return GetAPIName();
 
     // Special case templates:
     if( IsTemplate() && !pImp->aTitle.isEmpty() &&
          ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
-        return X(pImp->aTitle);
+        return pImp->aTitle;
 
     // Picklist/Caption is mapped
     if ( pMed && ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
@@ -836,7 +825,7 @@ OUString SfxObjectShell::GetTitle
         // considered. (See below, analysis of aTitleMap_Impl)
         const SfxStringItem* pNameItem = SfxItemSet::GetItem<SfxStringItem>(pMed->GetItemSet(), SID_DOCINFO_TITLE, false);
         if ( pNameItem )
-            return X( pNameItem->GetValue() );
+            return pNameItem->GetValue();
     }
 
     // Still unnamed?
@@ -845,7 +834,7 @@ OUString SfxObjectShell::GetTitle
     {
         // Title already set?
         if ( !pImp->aTitle.isEmpty() )
-            return X(pImp->aTitle);
+            return pImp->aTitle;
 
         // must it be numbered?
         OUString aNoName(SFX2_RESSTR(STR_NONAME));
@@ -856,7 +845,7 @@ OUString SfxObjectShell::GetTitle
         }
 
         // Document called "noname" for the time being
-        return X(aNoName);
+        return aNoName;
     }
 
     const INetURLObject aURL( IsDocShared() ? GetSharedFileURL() : OUString( GetMedium()->GetName() ) );
@@ -875,10 +864,9 @@ OUString SfxObjectShell::GetTitle
     {
         OUString aName( aURL.HasMark() ? INetURLObject( aURL.GetURLNoMark() ).PathToFileName() : aURL.PathToFileName() );
         if ( nMaxLength == SFX_TITLE_FULLNAME )
-            return X( aName );
+            return aName;
         else if ( nMaxLength == SFX_TITLE_FILENAME )
-            return X( aURL.getName( INetURLObject::LAST_SEGMENT,
-                true, INetURLObject::DECODE_WITH_CHARSET ) );
+            return aURL.getName(INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET);
         else if ( pImp->aTitle.isEmpty() )
             pImp->aTitle = aURL.getBase( INetURLObject::LAST_SEGMENT,
                                          true, INetURLObject::DECODE_WITH_CHARSET );
@@ -892,10 +880,10 @@ OUString SfxObjectShell::GetTitle
             {
                 OUString aRet( "..." );
                 aRet += aComplete.copy( aComplete.getLength() - nMaxLength + 3, nMaxLength - 3 );
-                return X( aRet );
+                return aRet;
             }
             else
-                return X( aComplete );
+                return aComplete;
         }
         else if ( nMaxLength == SFX_TITLE_FILENAME )
         {
@@ -903,10 +891,10 @@ OUString SfxObjectShell::GetTitle
             aName = INetURLObject::decode( aName, INetURLObject::DECODE_WITH_CHARSET );
             if( aName.isEmpty() )
                 aName = aURL.GetURLNoPass();
-            return X(aName);
+            return aName;
         }
         else if ( nMaxLength == SFX_TITLE_FULLNAME )
-            return X(aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ));
+            return aURL.GetMainURL( INetURLObject::DECODE_TO_IURI );
 
         // Generate Title from file name if possible
         if ( pImp->aTitle.isEmpty() )
@@ -918,7 +906,7 @@ OUString SfxObjectShell::GetTitle
     }
 
     // Complete Title
-    return X(pImp->aTitle);
+    return pImp->aTitle;
 }
 
 


More information about the Libreoffice-commits mailing list