[Libreoffice-commits] .: vcl/aqua vcl/source

2012-02-27 Thread Muthu Subramanian
 vcl/aqua/source/app/salinst.cxx |6 +++---
 vcl/aqua/source/app/salsys.cxx  |4 ++--
 vcl/aqua/source/dtrans/HtmlFmtFlt.cxx   |4 ++--
 vcl/aqua/source/dtrans/PictToBmpFlt.cxx |4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx   |5 ++---
 vcl/source/gdi/print3.cxx   |2 +-
 6 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit 5d1acca5a9d40d6197e12fd959c3644bcc60f799
Author: Chr. Rossmanith chrrossman...@gmx.de
Date:   Mon Feb 27 18:49:17 2012 +0530

Replace getLength() with isEmpty() where appropriate

diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 7a01b0b..794dd84 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -997,7 +997,7 @@ rtl::OUString AquaSalInstance::GetDefaultPrinter()
 // #i113170# may not be the main thread if called from UNO API
 SalData::ensureThreadAutoreleasePool();
 
-if( ! maDefaultPrinter.getLength() )
+if( maDefaultPrinter.isEmpty() )
 {
 NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo];
 DBG_ASSERT( pPI, no print info );
@@ -1138,10 +1138,10 @@ void AquaSalInstance::AddToRecentDocumentList(const 
rtl::OUString rFileUrl, con
 {
 // Convert file URL for external use (see above)
 rtl::OUString externalUrl = translateToExternalUrl(rFileUrl);
-if( 0 == externalUrl.getLength() )
+if( externalUrl.isEmpty() )
 externalUrl = rFileUrl;
 
-if( externalUrl.getLength()  !isDangerousUrl( externalUrl ) )
+if( !externalUrl.isEmpty()  !isDangerousUrl( externalUrl ) )
 {
 NSString* pString = CreateNSString( externalUrl );
 NSURL* pURL = [NSURL URLWithString: pString];
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 8a371d6..7c6f683 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -109,7 +109,7 @@ rtl::OUString AquaSalSystem::GetDisplayScreenName( unsigned 
int nScreen )
 static NSString* getStandardString( int nButtonId )
 {
 rtl::OUString aText( Button::GetStandardText( nButtonId ) );
-if( ! aText.getLength() ) // this is for bad cases, we might be missing 
the vcl resource
+if( aText.isEmpty() ) // this is for bad cases, we might be missing the 
vcl resource
 {
 switch( nButtonId )
 {
@@ -121,7 +121,7 @@ static NSString* getStandardString( int nButtonId )
 case BUTTON_NO :aText = rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( No ) );break;
 }
 }
-return aText.getLength() ? CreateNSString( aText) : nil;
+return aText.isEmpty() ? nil : CreateNSString( aText);
 }
 
 int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString rTitle,
diff --git a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx 
b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
index 0bd461d..275f5a1 100644
--- a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
+++ b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
@@ -65,9 +65,9 @@ const std::string TAG_END_BODY = std::string(/BODY);
 
 Sequencesal_Int8 SAL_CALL TextHtmlToHTMLFormat(Sequencesal_Int8 aTextHtml)
 {
-OSL_ASSERT(aTextHtml.getLength()  0);
+OSL_ASSERT(!aTextHtml.isEmpty());
 
-if (!(aTextHtml.getLength()  0))
+if (aTextHtml.isEmpty())
 return Sequencesal_Int8();
 
 // fill the buffer with dummy values to calc the exact length
diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx 
b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
index 3eb4fb8..4b3d371 100644
--- a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
+++ b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
@@ -161,7 +161,7 @@ bool ImageToBMP( com::sun::star::uno::Sequencesal_Int8 
aPict,
 {
 aBmp.realloc( [pOut length] );
 [pOut getBytes: aBmp.getArray() length: aBmp.getLength()];
-bResult = (aBmp.getLength() != 0);
+bResult = (!aBmp.isEmpty());
 }
 }
 }
@@ -190,7 +190,7 @@ bool BMPToImage( com::sun::star::uno::Sequencesal_Int8 
aBmp,
 {
 aPict.realloc( [pOut length] );
 [pOut getBytes: aPict.getArray() length: aPict.getLength()];
-bResult = (aPict.getLength() != 0);
+bResult = (!aPict.isEmpty());
 }
 }
 }
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 8456d86..3820d81 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6698,11 +6698,10 @@ PDFStreamIf::~PDFStreamIf()
 
 void SAL_CALL  PDFStreamIf::writeBytes( const com::sun::star::uno::Sequence 
sal_Int8  aData ) throw()
 {
-if( m_bWrite )
+if( m_bWrite  aData.getLength() )
 {
 sal_Int32 nBytes = aData.getLength();
-if( nBytes  0 )
-m_pWriter-writeBuffer( aData.getConstArray(), nBytes );
+m_pWriter-writeBuffer( aData.getConstArray(), nBytes );
 }
 }
 
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx

[Libreoffice-commits] .: vcl/aqua vcl/source

2012-02-27 Thread Ivan Timofeev
 vcl/aqua/source/dtrans/HtmlFmtFlt.cxx   |4 ++--
 vcl/aqua/source/dtrans/PictToBmpFlt.cxx |4 ++--
 vcl/source/gdi/print3.cxx   |2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit c581d33dec47a4c411a034482876543f6357d1e8
Author: Ivan Timofeev timofeev@gmail.com
Date:   Mon Feb 27 17:12:33 2012 +0400

there is no Sequence::isEmpty()

diff --git a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx 
b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
index 275f5a1..0bd461d 100644
--- a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
+++ b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
@@ -65,9 +65,9 @@ const std::string TAG_END_BODY = std::string(/BODY);
 
 Sequencesal_Int8 SAL_CALL TextHtmlToHTMLFormat(Sequencesal_Int8 aTextHtml)
 {
-OSL_ASSERT(!aTextHtml.isEmpty());
+OSL_ASSERT(aTextHtml.getLength()  0);
 
-if (aTextHtml.isEmpty())
+if (!(aTextHtml.getLength()  0))
 return Sequencesal_Int8();
 
 // fill the buffer with dummy values to calc the exact length
diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx 
b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
index 4b3d371..3eb4fb8 100644
--- a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
+++ b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
@@ -161,7 +161,7 @@ bool ImageToBMP( com::sun::star::uno::Sequencesal_Int8 
aPict,
 {
 aBmp.realloc( [pOut length] );
 [pOut getBytes: aBmp.getArray() length: aBmp.getLength()];
-bResult = (!aBmp.isEmpty());
+bResult = (aBmp.getLength() != 0);
 }
 }
 }
@@ -190,7 +190,7 @@ bool BMPToImage( com::sun::star::uno::Sequencesal_Int8 
aBmp,
 {
 aPict.realloc( [pOut length] );
 [pOut getBytes: aPict.getArray() length: aPict.getLength()];
-bResult = (!aPict.isEmpty());
+bResult = (aPict.getLength() != 0);
 }
 }
 }
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index abdece6..482491d 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1336,7 +1336,7 @@ void PrinterController::setValue( const 
beans::PropertyValue i_rValue )
 
 void PrinterController::setUIOptions( const Sequence beans::PropertyValue  
i_rOptions )
 {
-DBG_ASSERT( mpImplData-maUIOptions.isEmpty(), setUIOptions called twice 
! );
+DBG_ASSERT( mpImplData-maUIOptions.getLength() == 0, setUIOptions called 
twice ! );
 
 mpImplData-maUIOptions = i_rOptions;
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: vcl/aqua vcl/source vcl/unx

2012-02-21 Thread Josh Heidenreich
 vcl/aqua/source/app/salinst.cxx|3 ---
 vcl/aqua/source/window/salmenu.cxx |2 +-
 vcl/source/app/svdata.cxx  |   14 --
 vcl/source/window/winproc.cxx  |   12 ++--
 vcl/unx/gtk/window/gtkframe.cxx|   11 ---
 5 files changed, 3 insertions(+), 39 deletions(-)

New commits:
commit 936ebcfa4b44a90bdc8789ce7556f1ba3599375c
Author: Josh Heidenreich josh.sickm...@gmail.com
Date:   Tue Feb 21 13:06:11 2012 +1030

EasyHack fdo#46258 Removal of VCL testtool support (-enableautomation 
option)

diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index adae096..7a01b0b 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -206,9 +206,6 @@ static void initNSApp()
selector: 
@selector(applicationWillResignActive:)
name: @AppleRemoteWillResignActive
object: nil ];
-
-if( ImplGetSVData()-mbIsTestTool )
-[NSApp activateIgnoringOtherApps: YES];
 }
 
 sal_Bool ImplSVMainHook( int * pnInit )
diff --git a/vcl/aqua/source/window/salmenu.cxx 
b/vcl/aqua/source/window/salmenu.cxx
index 23d0180..f358e47 100644
--- a/vcl/aqua/source/window/salmenu.cxx
+++ b/vcl/aqua/source/window/salmenu.cxx
@@ -542,7 +542,7 @@ sal_Bool AquaSalMenu::VisibleMenuBar()
 
 static const char *pExperimental = getenv (AQUA_NATIVE_MENUS);
 
-if ( ImplGetSVData()-mbIsTestTool || (pExperimental  
!strcasecmp(pExperimental, FALSE)) )
+if ( pExperimental  !strcasecmp(pExperimental, FALSE) )
 return sal_False;
 
 // End of experimental code enable/disable part
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 84b2df0..3cd 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -121,20 +121,6 @@ void ImplInitSVData()
 pImplSVData-maHelpData.mbAutoHelpId = sal_True;
 pImplSVData-maNWFData.maMenuBarHighlightTextColor = Color( 
COL_TRANSPARENT );
 
-// find out whether we are running in the testtool
-// in this case we need some special workarounds
-sal_uInt32 nArgs = osl_getCommandArgCount();
-for( sal_uInt32 i = 0; i  nArgs; i++ )
-{
-rtl::OUString aArg;
-osl_getCommandArg( i, aArg.pData );
-if( aArg.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( -enableautomation 
) ) )
-{
-pImplSVData-mbIsTestTool = true;
-break;
-}
-}
-
 // mark default layout border as unitialized
 pImplSVData-maAppData.mnDefaultLayoutBorder = -1;
 }
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a306fa5..504b753 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1851,15 +1851,11 @@ static void ImplHandleGetFocus( Window* pWindow )
 // do not blink when they receive focus
 if ( !pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId )
 {
-bool bCallDirect = ImplGetSVData()-mbIsTestTool;
 pWindow-ImplGetWindowImpl()-mpFrameData-mbStartFocusState = 
!pWindow-ImplGetWindowImpl()-mpFrameData-mbHasFocus;
-if( ! bCallDirect )
-Application::PostUserEvent( 
pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId, LINK( pWindow, Window, 
ImplAsyncFocusHdl ) );
+Application::PostUserEvent( 
pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId, LINK( pWindow, Window, 
ImplAsyncFocusHdl ) );
 Window* pFocusWin = 
pWindow-ImplGetWindowImpl()-mpFrameData-mpFocusWin;
 if ( pFocusWin  pFocusWin-ImplGetWindowImpl()-mpCursor )
 pFocusWin-ImplGetWindowImpl()-mpCursor-ImplShow();
-if( bCallDirect )
-pWindow-ImplAsyncFocusHdl( NULL );
 }
 }
 
@@ -1892,19 +1888,15 @@ static void ImplHandleLoseFocus( Window* pWindow )
 
 // execute Focus-Events after a delay, such that SystemChildWindows
 // do not flicker when they receive focus
-bool bCallDirect = ImplGetSVData()-mbIsTestTool;
 if ( !pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId )
 {
 pWindow-ImplGetWindowImpl()-mpFrameData-mbStartFocusState = 
!pWindow-ImplGetWindowImpl()-mpFrameData-mbHasFocus;
-if( ! bCallDirect )
-Application::PostUserEvent( 
pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId, LINK( pWindow, Window, 
ImplAsyncFocusHdl ) );
+Application::PostUserEvent( 
pWindow-ImplGetWindowImpl()-mpFrameData-mnFocusId, LINK( pWindow, Window, 
ImplAsyncFocusHdl ) );
 }
 
 Window* pFocusWin = pWindow-ImplGetWindowImpl()-mpFrameData-mpFocusWin;
 if ( pFocusWin  pFocusWin-ImplGetWindowImpl()-mpCursor )
 pFocusWin-ImplGetWindowImpl()-mpCursor-ImplHide();
-if( bCallDirect )
-pWindow-ImplAsyncFocusHdl( NULL );
 }
 
 // ---
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 7f4db68..7384a73 100644