[Libreoffice-commits] .: vcl/inc vcl/ios

Tor Lillqvist tml at kemper.freedesktop.org
Mon Sep 26 21:40:56 PDT 2011


 vcl/inc/ios/vcluiapp.h             |    1 
 vcl/ios/source/app/salinst.cxx     |   69 +++++--------------------------------
 vcl/ios/source/app/salsys.cxx      |    2 +
 vcl/ios/source/app/vcluiapp.mm     |    3 +
 vcl/ios/source/gdi/salgdi.cxx      |   58 ++++++-------------------------
 vcl/ios/source/window/salframe.cxx |   26 ++++++-------
 vcl/ios/source/window/salmenu.cxx  |    4 +-
 vcl/ios/source/window/salobj.cxx   |    2 -
 8 files changed, 43 insertions(+), 122 deletions(-)

New commits:
commit 36e4ca307cb9f282f72231ae05c210469c31dfc2
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Sep 26 21:31:28 2011 +0300

    WaE: Silence warnings for the iOS code
    
    No semantic changes, the iOS code still is mostly dummy.

diff --git a/vcl/inc/ios/vcluiapp.h b/vcl/inc/ios/vcluiapp.h
index df4a01e..7707b2b 100644
--- a/vcl/inc/ios/vcluiapp.h
+++ b/vcl/inc/ios/vcluiapp.h
@@ -43,7 +43,6 @@ class IosSalFrame;
 -(void)sendSuperEvent:(UIEvent*)pEvent;
 -(BOOL)application: (UIApplication*) app openFile: (NSString*)file;
 -(void)application: (UIApplication*) app openFiles: (NSArray*)files;
--(void)applicationWillTerminate: (UIApplication *) app;
 -(void)addFallbackMenuItem: (UIMenuItem*)pNewItem;
 -(void)removeFallbackMenuItem: (UIMenuItem*)pOldItem;
 @end
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index f95930b..fb5bfb9 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -74,7 +74,6 @@ extern sal_Bool ImplSVMain();
 
 static int* gpnInit = 0;
 static bool bNoSVMain = true;
-static bool bLeftMain = false;
 // -----------------------------------------------------------------------
 
 class IosDelayedSettingsChanged : public Timer
@@ -129,12 +128,13 @@ static void initUIApp()
 
 sal_Bool ImplSVMainHook( int * pnInit )
 {
+    char sMain[] = "main";
     gpnInit = pnInit;
 
     bNoSVMain = false;
     initUIApp();
 
-    char* pArgv[] = { "main", NULL };
+    char* pArgv[] = { sMain, NULL };
     UIApplicationMain( 1, pArgv, NULL, NULL );
 
     return TRUE;   // indicate that ImplSVMainHook is implemented
@@ -588,6 +588,7 @@ void IosSalInstance::DestroyObject( SalObject* pObject )
 
 SalPrinter* IosSalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter )
 {
+    (void) pInfoPrinter;
     return NULL;
 }
 
@@ -603,6 +604,7 @@ void IosSalInstance::DestroyPrinter( SalPrinter* pPrinter )
 void IosSalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
 {
     // ???
+    (void) pList;
 }
 
 // -----------------------------------------------------------------------
@@ -633,13 +635,18 @@ XubString IosSalInstance::GetDefaultPrinter()
 // -----------------------------------------------------------------------
 
 SalInfoPrinter* IosSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
-                                                ImplJobSetup* pSetupData )
+                                                   ImplJobSetup* pSetupData )
 {
+    (void) pQueueInfo;
+    (void) pSetupData;
+
     // #i113170# may not be the main thread if called from UNO API
     SalData::ensureThreadAutoreleasePool();
 
     SalInfoPrinter* pNewInfoPrinter = NULL;
+
     // ???
+
     return pNewInfoPrinter;
 }
 
@@ -688,61 +695,7 @@ void* IosSalInstance::GetConnectionIdentifier( ConnectionIdentifierType& rReturn
     return (void*)"";
 }
 
-// We need to re-encode file urls because osl_getFileURLFromSystemPath converts
-// to UTF-8 before encoding non ascii characters, which is not what other apps expect.
-static rtl::OUString translateToExternalUrl(const rtl::OUString& internalUrl)
-{
-    rtl::OUString extUrl;
-
-    uno::Reference< lang::XMultiServiceFactory > sm = comphelper::getProcessServiceFactory();
-    if (sm.is())
-    {
-        uno::Reference< beans::XPropertySet > pset;
-        sm->queryInterface( getCppuType( &pset )) >>= pset;
-        if (pset.is())
-        {
-            uno::Reference< uno::XComponentContext > context;
-            static const rtl::OUString DEFAULT_CONTEXT( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) );
-            pset->getPropertyValue(DEFAULT_CONTEXT) >>= context;
-            if (context.is())
-                extUrl = uri::ExternalUriReferenceTranslator::create(context)->translateToExternal(internalUrl);
-        }
-    }
-    return extUrl;
-}
-
-// #i104525# many versions of OSX have problems with some URLs:
-// when an app requests OSX to add one of these URLs to the "Recent Items" list
-// then this app gets killed (TextEdit, Preview, etc. and also OOo)
-static bool isDangerousUrl( const rtl::OUString& rUrl )
-{
-    // use a heuristic that detects all known cases since there is no official comment
-    // on the exact impact and root cause of the OSX bug
-    const int nLen = rUrl.getLength();
-    const sal_Unicode* p = rUrl.getStr();
-    for( int i = 0; i < nLen-3; ++i, ++p ) {
-        if( p[0] != '%' )
-            continue;
-        // escaped percent?
-        if( (p[1] == '2') && (p[2] == '5') )
-            return true;
-        // escapes are considered to be UTF-8 encoded
-        // => check for invalid UTF-8 leading byte
-        if( (p[1] != 'f') && (p[1] != 'F') )
-            continue;
-        int cLowNibble = p[2];
-        if( (cLowNibble >= '0' ) && (cLowNibble <= '9'))
-            return false;
-        if( cLowNibble >= 'a' )
-            cLowNibble -= 'a' - 'A';
-        if( (cLowNibble < 'A') || (cLowNibble >= 'C'))
-            return true;
-    }
-
-    return false;
-}
-
-void IosSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& /*rMimeType*/)
+void IosSalInstance::AddToRecentDocumentList(const rtl::OUString& /*rFileUrl*/, const rtl::OUString& /*rMimeType*/)
 {
 }
 
diff --git a/vcl/ios/source/app/salsys.cxx b/vcl/ios/source/app/salsys.cxx
index 1baf357..9db87a5 100644
--- a/vcl/ios/source/app/salsys.cxx
+++ b/vcl/ios/source/app/salsys.cxx
@@ -155,6 +155,8 @@ static NSString* getStandardString( int nButtonId )
 
 - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
 {
+    (void) alertView;
+
     *_resultPtr = buttonIndex;
 }
 @end
diff --git a/vcl/ios/source/app/vcluiapp.mm b/vcl/ios/source/app/vcluiapp.mm
index d1aa842..c7461d9 100644
--- a/vcl/ios/source/app/vcluiapp.mm
+++ b/vcl/ios/source/app/vcluiapp.mm
@@ -46,7 +46,6 @@
 @implementation VCL_UIApplication
 -(void)sendEvent:(UIEvent*)pEvent
 {
-    UIEventType eType = [pEvent type];
     [super sendEvent: pEvent];
 }
 
@@ -89,11 +88,13 @@
 -(void)addFallbackMenuItem: (UIMenuItem*)pNewItem
 {
     // ???
+    (void) pNewItem;
 }
 
 -(void)removeFallbackMenuItem: (UIMenuItem*)pItem
 {
     // ???
+    (void) pItem;
 }
 
 @end
diff --git a/vcl/ios/source/gdi/salgdi.cxx b/vcl/ios/source/gdi/salgdi.cxx
index e627c76..374c633 100644
--- a/vcl/ios/source/gdi/salgdi.cxx
+++ b/vcl/ios/source/gdi/salgdi.cxx
@@ -1540,46 +1540,7 @@ bool IosSalGraphics::AddTempDevFont( ImplDevFontList*,
 // callbacks from ATSUGlyphGetCubicPaths() fore GetGlyphOutline()
 struct GgoData { basegfx::B2DPolygon maPolygon; basegfx::B2DPolyPolygon* mpPolyPoly; };
 
-static OSStatus GgoLineToProc( const Float32Point* pPoint, void* pData )
-{
-    basegfx::B2DPolygon& rPolygon = static_cast<GgoData*>(pData)->maPolygon;
-    const basegfx::B2DPoint aB2DPoint( pPoint->x, pPoint->y );
-    rPolygon.append( aB2DPoint );
-    return noErr;
-}
-
-static OSStatus GgoCurveToProc( const Float32Point* pCP1, const Float32Point* pCP2,
-    const Float32Point* pPoint, void* pData )
-{
-    basegfx::B2DPolygon& rPolygon = static_cast<GgoData*>(pData)->maPolygon;
-    const sal_uInt32 nPointCount = rPolygon.count();
-    const basegfx::B2DPoint aB2DControlPoint1( pCP1->x, pCP1->y );
-    rPolygon.setNextControlPoint( nPointCount-1, aB2DControlPoint1 );
-    const basegfx::B2DPoint aB2DEndPoint( pPoint->x, pPoint->y );
-    rPolygon.append( aB2DEndPoint );
-    const basegfx::B2DPoint aB2DControlPoint2( pCP2->x, pCP2->y );
-    rPolygon.setPrevControlPoint( nPointCount, aB2DControlPoint2 );
-    return noErr;
-}
-
-static OSStatus GgoClosePathProc( void* pData )
-{
-    GgoData* pGgoData = static_cast<GgoData*>(pData);
-    basegfx::B2DPolygon& rPolygon = pGgoData->maPolygon;
-    if( rPolygon.count() > 0 )
-        pGgoData->mpPolyPoly->append( rPolygon );
-    rPolygon.clear();
-    return noErr;
-}
-
-static OSStatus GgoMoveToProc( const Float32Point* pPoint, void* pData )
-{
-    GgoClosePathProc( pData );
-    OSStatus eStatus = GgoLineToProc( pPoint, pData );
-    return eStatus;
-}
-
-sal_Bool IosSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly )
+sal_Bool IosSalGraphics::GetGlyphOutline( sal_GlyphId /*nGlyphId*/, basegfx::B2DPolyPolygon& rPolyPoly )
 {
     GgoData aGgoData;
     aGgoData.mpPolyPoly = &rPolyPoly;
@@ -1621,7 +1582,7 @@ long IosSalGraphics::GetGraphicsWidth() const
 
 // -----------------------------------------------------------------------
 
-sal_Bool IosSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect )
+sal_Bool IosSalGraphics::GetGlyphBoundRect( sal_GlyphId /*nGlyphId*/, Rectangle& rRect )
 {
 #if 0
     ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback
@@ -1800,6 +1761,8 @@ bool IosSalGraphics::GetImplFontCapabilities(vcl::FontCapabilities &rFontCapabil
 
 // -----------------------------------------------------------------------
 
+#if 0
+
 // fake a SFNT font directory entry for a font table
 // see http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html#Directory
 static void FakeDirEntry( FourCharCode eFCC, ByteCount nOfs, ByteCount nLen,
@@ -1827,12 +1790,14 @@ static void FakeDirEntry( FourCharCode eFCC, ByteCount nOfs, ByteCount nLen,
     rpDest += 16;
 }
 
-static bool GetRawFontData( const ImplFontData* pFontData,
-    ByteVector& rBuffer, bool* pJustCFF )
-{
-    const ImplIosFontData* pIosFont = static_cast<const ImplIosFontData*>(pFontData);
+#endif
 
+static bool GetRawFontData( const ImplFontData* /*pFontData*/,
+                            ByteVector& /*rBuffer*/,
+                            bool* /*pJustCFF*/ )
+{
 #if 0
+    const ImplIosFontData* pIosFont = static_cast<const ImplIosFontData*>(pFontData);
     const ATSUFontID nFontId = static_cast<ATSUFontID>(pIosFont->GetFontId());
     ATSFontRef rFont = FMGetATSFontRefFromFont( nFontId );
 
@@ -2216,10 +2181,11 @@ void IosSalGraphics::FreeEmbedFontData( const void* pData, long /*nDataLen*/ )
 SystemFontData IosSalGraphics::GetSysFontData( int /* nFallbacklevel */ ) const
 {
     SystemFontData aSysFontData;
-    OSStatus err;
     aSysFontData.nSize = sizeof( SystemFontData );
 
 #if 0
+    OSStatus err;
+
     // NOTE: Native ATSU font fallbacks are used, not the VCL fallbacks.
     ATSUFontID fontId;
     err = ATSUGetAttribute( maATSUStyle, kATSUFontTag, sizeof(fontId), &fontId, 0 );
diff --git a/vcl/ios/source/window/salframe.cxx b/vcl/ios/source/window/salframe.cxx
index f0745ed..8e2ea9d 100644
--- a/vcl/ios/source/window/salframe.cxx
+++ b/vcl/ios/source/window/salframe.cxx
@@ -382,8 +382,8 @@ void IosSalFrame::SetMinClientSize( long nWidth, long nHeight )
         nWidth += maGeometry.nLeftDecoration + maGeometry.nRightDecoration;
         nHeight += maGeometry.nTopDecoration + maGeometry.nBottomDecoration;
 
-        CGSize aSize = { nWidth, nHeight };
 #if 0 // ???
+        CGSize aSize = { nWidth, nHeight };
         // Size of full window (content+structure) although we only
         // have the client size in arguments
         [mpWindow setMinSize: aSize];
@@ -412,8 +412,8 @@ void IosSalFrame::SetMaxClientSize( long nWidth, long nHeight )
         if (nWidth>32767) nWidth=32767;
         if (nHeight>32767) nHeight=32767;
 
-        CGSize aSize = { nWidth, nHeight };
 #if 0 // ???
+        CGSize aSize = { nWidth, nHeight };
         // Size of full window (content+structure) although we only
         // have the client size in arguments
         [mpWindow setMaxSize: aSize];
@@ -423,15 +423,15 @@ void IosSalFrame::SetMaxClientSize( long nWidth, long nHeight )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::SetClientSize( long nWidth, long nHeight )
+void IosSalFrame::SetClientSize( long /*nWidth*/, long /*nHeight*/ )
 {
     // #i113170# may not be the main thread if called from UNO API
     SalData::ensureThreadAutoreleasePool();
 
     if( mpWindow )
     {
-        CGSize aSize = { nWidth, nHeight };
 #if 0 // ???
+        CGSize aSize = { nWidth, nHeight };
         [mpWindow setContentSize: aSize];
 #endif
         UpdateFrameGeometry();
@@ -521,7 +521,7 @@ sal_Bool IosSalFrame::GetWindowState( SalFrameState* pState )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::SetScreenNumber(unsigned int nScreen)
+void IosSalFrame::SetScreenNumber(unsigned int /*nScreen*/)
 {
     // ???
 }
@@ -532,14 +532,14 @@ void IosSalFrame::SetApplicationID( const rtl::OUString &/*rApplicationID*/ )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::ShowFullScreen( sal_Bool bFullScreen, sal_Int32 nDisplay )
+void IosSalFrame::ShowFullScreen( sal_Bool /*bFullScreen*/, sal_Int32 /*nDisplay*/ )
 {
     // ???
 }
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::StartPresentation( sal_Bool bStart )
+void IosSalFrame::StartPresentation( sal_Bool /*bStart*/ )
 {
     if ( !mpWindow )
         return;
@@ -555,7 +555,7 @@ void IosSalFrame::SetAlwaysOnTop( sal_Bool )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::ToTop(sal_uInt16 nFlags)
+void IosSalFrame::ToTop(sal_uInt16 /*nFlags*/)
 {
     if ( !mpWindow )
         return;
@@ -565,7 +565,7 @@ void IosSalFrame::ToTop(sal_uInt16 nFlags)
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::SetPointer( PointerStyle ePointerStyle )
+void IosSalFrame::SetPointer( PointerStyle /*ePointerStyle*/ )
 {
 }
 
@@ -584,7 +584,7 @@ void IosSalFrame::Flush( void )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::Flush( const Rectangle& rRect )
+void IosSalFrame::Flush( const Rectangle& /*rRect*/ )
 {
     // ???
 }
@@ -793,7 +793,7 @@ void IosSalFrame::Beep( SoundType eSoundType )
 
 // -----------------------------------------------------------------------
 
-void IosSalFrame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags)
+void IosSalFrame::SetPosSize(long /*nX*/, long /*nY*/, long /*nWidth*/, long /*nHeight*/, sal_uInt16 nFlags)
 {
     if ( !mpWindow )
         return;
@@ -950,7 +950,7 @@ void IosSalFrame::DrawMenuBar()
 {
 }
 
-void IosSalFrame::SetMenu( SalMenu* pSalMenu )
+void IosSalFrame::SetMenu( SalMenu* /*pSalMenu*/ )
 {
     // #i113170# may not be the main thread if called from UNO API
     SalData::ensureThreadAutoreleasePool();
@@ -958,7 +958,7 @@ void IosSalFrame::SetMenu( SalMenu* pSalMenu )
     // ???
 }
 
-void IosSalFrame::SetExtendedFrameStyle( SalExtStyle nStyle )
+void IosSalFrame::SetExtendedFrameStyle( SalExtStyle /*nStyle*/ )
 {
     // ???
 }
diff --git a/vcl/ios/source/window/salmenu.cxx b/vcl/ios/source/window/salmenu.cxx
index 0cda822..d24a027 100644
--- a/vcl/ios/source/window/salmenu.cxx
+++ b/vcl/ios/source/window/salmenu.cxx
@@ -44,7 +44,7 @@
 
 // =======================================================================
 
-SalMenu* IosSalInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
+SalMenu* IosSalInstance::CreateMenu( sal_Bool /*bMenuBar*/, Menu* /*pVCLMenu*/ )
 {
     // ???
     return NULL;
@@ -55,7 +55,7 @@ void IosSalInstance::DestroyMenu( SalMenu* pSalMenu )
     delete pSalMenu;
 }
 
-SalMenuItem* IosSalInstance::CreateMenuItem( const SalItemParams* pItemData )
+SalMenuItem* IosSalInstance::CreateMenuItem( const SalItemParams* /*pItemData*/ )
 {
     // ???
     return NULL;
diff --git a/vcl/ios/source/window/salobj.cxx b/vcl/ios/source/window/salobj.cxx
index e55b087..b9c73c6 100644
--- a/vcl/ios/source/window/salobj.cxx
+++ b/vcl/ios/source/window/salobj.cxx
@@ -194,7 +194,7 @@ void IosSalObject::setClippedPosSize()
 
 // -----------------------------------------------------------------------
 
-void IosSalObject::Show( sal_Bool bVisible )
+void IosSalObject::Show( sal_Bool /*bVisible*/ )
 {
 #if 0 // ???
     if( mpClipView )


More information about the Libreoffice-commits mailing list