[Libreoffice-commits] core.git: Branch 'ports/macosx10.5/master' - 17 commits - accessibility/inc accessibility/source android/Bootstrap basctl/source basic/source bridges/source chart2/source comphelper/inc comphelper/source config_host/config_version.h.in config_host.mk.in configure.ac connectivity/inc connectivity/source cppuhelper/qa cppuhelper/source cppuhelper/test cui/inc cui/source dbaccess/inc dbaccess/source desktop/inc desktop/source desktop/test desktop/util desktop/win32 desktop/WinResTarget_sbase.mk desktop/WinResTarget_scalc.mk desktop/WinResTarget_sdraw.mk desktop/WinResTarget_simpress.mk desktop/WinResTarget_smath.mk desktop/WinResTarget_sofficebin.mk desktop/WinResTarget_soffice.mk desktop/WinResTarget_sweb.mk desktop/WinResTarget_swriter.mk drawinglayer/inc drawinglayer/source editeng/inc editeng/source embeddedobj/source extensions/source external/apache-commons external/beanshell external/hsqldb external/jfreereport external/languagetool external/rhino forms/inc forms/source fpicker/source include/basegfx include/basic include/canvas include/comphelper include/connectivity include/cppuhelper include/dbaccess include/default.rc include/drawinglayer include/editeng include/formula include/sax include/sfx2 include/svl include/svtools include/svx include/toolkit include/ucbhelper include/unotools include/version.hrc include/xmloff include/xmlscript instsetoo_native/CustomTarget_install.mk instsetoo_native/CustomTarget_setup.mk instsetoo_native/util lotuswordpro/inc lotuswordpro/source mysqlc/source odk/CustomTarget_settings.mk odk/examples odk/Package_odk_headers.mk postprocess/CustomTarget_registry.mk remotebridges/examples reportdesign/source sc/inc sc/source setup_native/install_name_patcher.app sfx2/source solenv/bin solenv/gbuild sot/inc stoc/source svgio/inc svgio/source svl/source svtools/inc svtools/source svx/inc svx/source sw/inc sw/Module_sw.mk sysui/CustomTarget_deb.mk sysui/CustomTarget_rpm.mk sysui/desktop toolkit/source unotools/source ure/so urce uui/inc vcl/inc vcl/osx vcl/source writerfilter/inc xmloff/inc xmloff/source

Douglas Mencken dougmencken at gmail.com
Sat Oct 24 11:21:25 UTC 2015


Rebased ref, commits from common ancestor:
commit 6cb8c46b28c3d6d33d90cbc94dc6cbc157ae158f
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Oct 21 16:50:40 2015 -0400

    Fix “Guía problem”
    
    “Guía problem” is actually an unability (i.e. crash) to add new formula
    or to open existing file with formulas ...
    
    ... terminate called after throwing an instance of 'com::sun::star::uno::RuntimeException'
    program received signal SIGABRT, aborted
    b a c k t r a c e
     0  __kill
     1  abort
    ...
     5  __cxa_throw
     6  com::sun::star::uno::BaseReference::iquery_throw
     7  SfxObjectShell::SetupStorage
     8  SfxBaseModel::storeToStorage
     9  OCommonEmbeddedObject::StoreDocToStorage_Impl
    10  OCommonEmbeddedObject::storeAsEntry
    11  comphelper::EmbeddedObjectContainer::StoreEmbeddedObject
    12  comphelper::EmbeddedObjectContainer::InsertEmbeddedObject
    ...
    
    Fantastically enough that exception cannot be caught even with `catch (...)'
    
    What's interesting introduced by this patch
    
    • make ``uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY );''
      not to be a first line in SfxObjectShell::SetupStorage
    
    • add SAL_INFOs to know how the code flows
    
    • use `catch ( ... )' here and there
    
    • don't throw exceptions from OStorageHelper::GetXStorageFormat in the case when
      media type returned from xStorProps->getPropertyValue("MediaType") is empty
    
    • `return' instead of throwing an exception for the case when `!xStorage.is()'
      in OCommonEmbeddedObject::StoreDocToStorage_Impl
    
    Change-Id: I1241518a7ce87f68da71655f6f7f0a9ab9cb6bdb

diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index caa2d25..c8e2fa1 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -467,6 +467,8 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
     const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName, bool bCopy,
     const OUString& rSrcShellID, const OUString& rDestShellID )
 {
+    SAL_INFO( "comphelper.container", "entering >>EmbeddedObjectContainer::StoreEmbeddedObject<<" );
+
     uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
     if ( rName.isEmpty() )
         rName = CreateUniqueObjectName();
@@ -500,9 +502,9 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
             }
         }
     }
-    catch (uno::Exception const& e)
+    catch ( uno::Exception const& ex )
     {
-        SAL_WARN("comphelper.container", "EmbeddedObjectContainer::StoreEmbeddedObject: exception caught: " << e.Message);
+        SAL_WARN( "comphelper.container", "EmbeddedObjectContainer::StoreEmbeddedObject: exception caught: " << ex.Message );
         // TODO/LATER: better error recovery should keep storage intact
         return false;
     }
@@ -512,6 +514,8 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
 
 bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )
 {
+    SAL_INFO( "comphelper.container", "entering >>bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < embed::XEmbeddedObject >& xObj, OUString& rName )<<" );
+
     // store it into the container storage
     if (StoreEmbeddedObject(xObj, rName, false, OUString(), OUString()))
     {
@@ -519,12 +523,14 @@ bool EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < embed
         AddEmbeddedObject( xObj, rName );
         return true;
     }
-    else
-        return false;
+
+    return false;
 }
 
 uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < io::XInputStream >& xStm, OUString& rNewName )
 {
+    SAL_INFO( "comphelper.container", "entering >>uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const uno::Reference < io::XInputStream >& xStm, OUString& rNewName )<<" );
+
     if ( rNewName.isEmpty() )
         rNewName = CreateUniqueObjectName();
 
@@ -585,6 +591,8 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbedde
 
 uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >& aMedium, OUString& rNewName )
 {
+    SAL_INFO( "comphelper.container", "entering >>uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::InsertEmbeddedObject( const css::uno::Sequence < css::beans::PropertyValue >& aMedium, OUString& rNewName )<<" );
+
     if ( rNewName.isEmpty() )
         rNewName = CreateUniqueObjectName();
 
diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx
index b2fe5d9..95d386f 100644
--- a/comphelper/source/misc/storagehelper.cxx
+++ b/comphelper/source/misc/storagehelper.cxx
@@ -231,11 +231,19 @@ sal_Int32 OStorageHelper::GetXStorageFormat(
             const uno::Reference< embed::XStorage >& xStorage )
         throw ( uno::Exception, std::exception )
 {
+    SAL_INFO( "comphelper.misc", "entering >>OStorageHelper::GetXStorageFormat<<" );
+
     uno::Reference< beans::XPropertySet > xStorProps( xStorage, uno::UNO_QUERY_THROW );
 
     OUString aMediaType;
     xStorProps->getPropertyValue("MediaType") >>= aMediaType;
 
+    if ( aMediaType.getLength() == 0 )
+    {
+        // media type is empty '' string
+        return SOFFICE_FILEFORMAT_CURRENT;
+    }
+
     sal_Int32 nResult = 0;
 
     // TODO/LATER: the filter configuration could be used to detect it later, or batter a special service
@@ -278,13 +286,18 @@ sal_Int32 OStorageHelper::GetXStorageFormat(
     else
     {
         // the mediatype is not known
-        OUString aMsg(BOOST_CURRENT_FUNCTION);
-        aMsg += ":";
-        aMsg += OUString::number(__LINE__);
-        aMsg += ": unknown media type '";
-        aMsg += aMediaType;
-        aMsg += "'";
-        throw beans::IllegalTypeException(aMsg);
+        OUString msg(BOOST_CURRENT_FUNCTION);
+        msg += ":";
+        msg += OUString::number(__LINE__);
+        //msg += ": unknown media type '";
+        //msg += aMediaType;
+        //msg += "'";
+        OString oMediaType = OUStringToOString( aMediaType, RTL_TEXTENCODING_ASCII_US );
+        SAL_INFO( "comphelper.misc",
+                  msg << ": unknown media type" <<
+                  " \'" << oMediaType.pData->buffer << "\'" );
+        // assume it fits to format which is used now
+        return SOFFICE_FILEFORMAT_CURRENT;
     }
 
     return nResult;
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 5b84c98..0df19ba 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -754,10 +754,13 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl(
     const OUString& aHierarchName,
     bool bAttachToTheStorage )
 {
-    SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "No storage is provided for storing!" );
+    SAL_INFO( "embeddedobj.common", "entering >>OCommonEmbeddedObject::StoreDocToStorage_Impl<<" );
 
     if ( !xStorage.is() )
-        throw uno::RuntimeException(); // TODO:
+    {
+        SAL_WARN( "embeddedobj.common", "No storage is provided for storing" );
+        return; // just return enjoying the silence
+    }
 
     uno::Reference< document::XStorageBasedDocument > xDoc;
     {
@@ -792,7 +795,12 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl(
         aArgs[4].Name = "DestinationShellID";
         aArgs[4].Value <<= getStringPropertyValue(rObjArgs, "DestinationShellID");
 
-        xDoc->storeToStorage( xStorage, aArgs );
+        try
+        {
+            xDoc->storeToStorage( xStorage, aArgs );
+        }
+        catch ( ... ) { }
+
         if ( bAttachToTheStorage )
             SwitchDocToStorage_Impl( xDoc, xStorage );
     }
@@ -1162,6 +1170,8 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed::
                 uno::Exception,
                 uno::RuntimeException, std::exception )
 {
+    SAL_INFO( "embeddedobj.common", "entering >>OCommonEmbeddedObject::storeToEntry<<" );
+
     ::osl::ResettableMutexGuard aGuard( m_aMutex );
     if ( m_bDisposed )
         throw lang::DisposedException(); // TODO
@@ -1293,6 +1303,8 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed::
                 uno::Exception,
                 uno::RuntimeException, std::exception )
 {
+    SAL_INFO( "embeddedobj.common", "entering >>OCommonEmbeddedObject::storeAsEntry<<" );
+
     // TODO: use lObjArgs
 
     ::osl::ResettableMutexGuard aGuard( m_aMutex );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index d9c733e..af50124 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -338,94 +338,97 @@ SotClipboardFormatId GetChartVersion( sal_Int32 nVersion, bool bTemplate )
 void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xStorage,
                                    sal_Int32 nVersion, bool bTemplate, bool bChart ) const
 {
-    uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY );
+    SAL_INFO( "sfx2.doc", "entering >>SfxObjectShell::SetupStorage<<" );
 
-    if ( xProps.is() )
-    {
-        SvGlobalName aName;
-        OUString aFullTypeName, aShortTypeName, aAppName;
-        SotClipboardFormatId nClipFormat = SotClipboardFormatId::NONE;
+    SvGlobalName aName;
+    OUString aFullTypeName, aShortTypeName, aAppName;
+    SotClipboardFormatId nClipFormat = SotClipboardFormatId::NONE;
 
-        if(!bChart)
-            FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate );
-        else
-            nClipFormat = GetChartVersion(nVersion, bTemplate);
+    if (!bChart)
+        FillClass( &aName, &nClipFormat, &aAppName, &aFullTypeName, &aShortTypeName, nVersion, bTemplate );
+    else
+        nClipFormat = GetChartVersion( nVersion, bTemplate );
 
-        if ( nClipFormat != SotClipboardFormatId::NONE )
+    if ( nClipFormat != SotClipboardFormatId::NONE )
+    {
+        // basic doesn't have a ClipFormat
+        // without MediaType the storage is not really usable, but currently the BasicIDE still
+        // is an SfxObjectShell and so we can't take this as an error
+        datatransfer::DataFlavor aDataFlavor;
+        SotExchange::GetFormatDataFlavor( nClipFormat, aDataFlavor );
+        if ( !aDataFlavor.MimeType.isEmpty() )
         {
-            // basic doesn't have a ClipFormat
-            // without MediaType the storage is not really usable, but currently the BasicIDE still
-            // is an SfxObjectShell and so we can't take this as an error
-            datatransfer::DataFlavor aDataFlavor;
-            SotExchange::GetFormatDataFlavor( nClipFormat, aDataFlavor );
-            if ( !aDataFlavor.MimeType.isEmpty() )
+            uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY );
+            if ( !xProps.is() ) return;
+
+            try
             {
-                try
-                {
-                    xProps->setPropertyValue("MediaType", uno::makeAny( aDataFlavor.MimeType ) );
-                }
-                catch( uno::Exception& )
-                {
-                    const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX  ) );
-                }
+                xProps->setPropertyValue("MediaType", uno::makeAny( aDataFlavor.MimeType ) );
+            }
+            catch( ... )
+            {
+                const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX  ) );
+            }
 
-                SvtSaveOptions::ODFDefaultVersion nDefVersion = SvtSaveOptions::ODFVER_012;
-                bool bUseSHA1InODF12 = false;
-                bool bUseBlowfishInODF12 = false;
+            SvtSaveOptions::ODFDefaultVersion nDefVersion = SvtSaveOptions::ODFVER_012;
+            bool bUseSHA1InODF12 = false;
+            bool bUseBlowfishInODF12 = false;
 
-                if (!utl::ConfigManager::IsAvoidConfig())
-                {
-                    SvtSaveOptions aSaveOpt;
-                    nDefVersion = aSaveOpt.GetODFDefaultVersion();
-                    bUseSHA1InODF12 = aSaveOpt.IsUseSHA1InODF12();
-                    bUseBlowfishInODF12 = aSaveOpt.IsUseBlowfishInODF12();
-                }
+            if (!utl::ConfigManager::IsAvoidConfig())
+            {
+                SvtSaveOptions aSaveOpt;
+                nDefVersion = aSaveOpt.GetODFDefaultVersion();
+                bUseSHA1InODF12 = aSaveOpt.IsUseSHA1InODF12();
+                bUseBlowfishInODF12 = aSaveOpt.IsUseBlowfishInODF12();
+            }
 
-                uno::Sequence< beans::NamedValue > aEncryptionAlgs( 3 );
-                aEncryptionAlgs[0].Name = "StartKeyGenerationAlgorithm";
-                aEncryptionAlgs[1].Name = "EncryptionAlgorithm";
-                aEncryptionAlgs[2].Name = "ChecksumAlgorithm";
-                // the default values, that should be used for ODF1.1 and older formats
-                aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA1;
-                aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8;
-                aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA1_1K;
+            uno::Sequence< beans::NamedValue > aEncryptionAlgs( 3 );
+            aEncryptionAlgs[0].Name = "StartKeyGenerationAlgorithm";
+            aEncryptionAlgs[1].Name = "EncryptionAlgorithm";
+            aEncryptionAlgs[2].Name = "ChecksumAlgorithm";
+            // the default values, that should be used for ODF1.1 and older formats
+            aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA1;
+            aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::BLOWFISH_CFB_8;
+            aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA1_1K;
 
-                if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
+            if ( nDefVersion >= SvtSaveOptions::ODFVER_012 )
+            {
+                try
                 {
-                    try
-                    {
-                        // older versions can not have this property set, it exists only starting from ODF1.2
-                        xProps->setPropertyValue("Version", uno::makeAny<OUString>( ODFVER_012_TEXT ) );
-                    }
-                    catch( uno::Exception& )
-                    {
-                    }
-
-                    if ( !bUseSHA1InODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
-                    {
-                        aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA256;
-                        aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA256_1K;
-                    }
-                    if ( !bUseBlowfishInODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
-                        aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
+                    // older versions can not have this property set, it exists only starting from ODF1.2
+                    xProps->setPropertyValue("Version", uno::makeAny<OUString>( ODFVER_012_TEXT ) );
                 }
-
-                try
+                catch( ... )
                 {
-                    // set the encryption algorithms accordingly;
-                    // the setting does not trigger encryption,
-                    // it just provides the format for the case that contents should be encrypted
-                    uno::Reference< embed::XEncryptionProtectedStorage > xEncr( xStorage, uno::UNO_QUERY_THROW );
-                    xEncr->setEncryptionAlgorithms( aEncryptionAlgs );
                 }
-                catch( uno::Exception& )
+
+                if ( !bUseSHA1InODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
                 {
-                    const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX  ) );
+                    aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA256;
+                    aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA256_1K;
                 }
+                if ( !bUseBlowfishInODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
+                    aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
+            }
 
+            try
+            {
+                // set the encryption algorithms accordingly;
+                // the setting does not trigger encryption,
+                // it just provides the format for the case that contents should be encrypted
+                uno::Reference< embed::XEncryptionProtectedStorage > xEncr( xStorage, uno::UNO_QUERY_THROW );
+                xEncr->setEncryptionAlgorithms( aEncryptionAlgs );
+            }
+            catch( ... )
+            {
+                const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX  ) );
             }
+
         }
     }
+
+    //SAL_INFO( "sfx2.doc", "leaving >>SfxObjectShell::SetupStorage<<" );
+    return;
 }
 
 
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 5263318..859f099 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3763,6 +3763,8 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
             Exception,
             RuntimeException, std::exception )
 {
+    SAL_INFO( "sfx2.doc", "entering >>SfxBaseModel::storeToStorage<<" );
+
     SfxModelGuard aGuard( *this );
 
     Reference< embed::XStorage > xResult;
@@ -3789,11 +3791,13 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
         // storing to the own storage
         bSuccess = m_pData->m_pObjectShell->DoSave();
     }
-    else
+    else /* xStorage != m_pData->m_pObjectShell->GetStorage() */
     {
         // TODO/LATER: if the provided storage has some data inside the storing might fail, probably the storage must be truncated
         // TODO/LATER: is it possible to have a template here?
-        m_pData->m_pObjectShell->SetupStorage( xStorage, nVersion, false );
+        try {
+            m_pData->m_pObjectShell->SetupStorage( xStorage, nVersion, false );
+        } catch ( ... ) { }
 
         // BaseURL is part of the ItemSet
         SfxMedium aMedium( xStorage, OUString(), &aSet );
@@ -3814,8 +3818,8 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >&
     {
         nError = nError ? nError : ERRCODE_IO_GENERAL;
         throw task::ErrorCodeIOException(
-            "SfxBaseModel::storeToStorage: 0x" + OUString::number(nError, 16),
-            Reference< XInterface >(), nError);
+            "SfxBaseModel::storeToStorage: $" + OUString::number(nError, 16),
+            Reference< XInterface >(), nError );
     }
 }
 
commit 6f9bef14f7cf9e75621d9f0525c003f1c6aefe92
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sat Oct 24 19:03:33 2015 +1000

    tdf#95220: Check if DrawingLayer is not nullptr
    
    bool ScDocShell::isTiledRendering() const crashed without this check
    
    Author: Mike Kaganski <mike.kaganski at collabora.com> Sat, 24 Oct 2015 05:03:33 -0400
    Change-Id: Idb7ace05eb1aa37cbc3d956503c046b0e9b9d0e5

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f35d181..81c3555 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3196,7 +3196,7 @@ void ScDocShell::libreOfficeKitCallback(int nType, const char* pPayload) const
 
 bool ScDocShell::isTiledRendering() const
 {
-    return aDocument.GetDrawLayer()->isTiledRendering();
+    return aDocument.GetDrawLayer() && aDocument.GetDrawLayer()->isTiledRendering();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 436400c33714a3c6d2e601d72a3660d7bbfb6e16
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Wed Oct 21 09:59:34 2015 -0400

    vcl.osx.print: bin >>vintage<< implementation
    
    Change-Id: I09958e48846962aa5ad29e3e6cc0ce2450973f74

diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index 80d972e..b4042d2 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -45,16 +45,6 @@ using namespace com::sun::star;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::uno;
 
-#if MACOSX_SDK_VERSION <= 1040
-// as long as you are linking with 10.4 libraries there's no preview
-# define VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-#  undef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
-#else
-// since 10.5 you can use multiple accessory views and have accessory views and a preview
-# define MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
-#  undef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-#endif
-
 class ControllerProperties;
 
 @interface ControlTarget : NSObject
@@ -64,14 +54,9 @@ class ControllerProperties;
 -(id)initWithControllerMap: (ControllerProperties*)pController;
 -(void)triggered:(id)pSender;
 -(void)triggeredNumeric:(id)pSender;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
--(void)triggeredPreview:(id)pSender;
-#endif
 -(void)dealloc;
 @end
 
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
-
 @interface AquaPrintPanelAccessoryController : NSViewController< NSPrintPanelAccessorizing >
 {
     NSPrintOperation *mpPrintOperation;
@@ -163,8 +148,6 @@ class ControllerProperties;
 
 @end
 
-#endif
-
 class ControllerProperties
 {
     std::map< int, rtl::OUString >      maTagToPropertyName;
@@ -174,51 +157,14 @@ class ControllerProperties
     int                                 mnNextTag;
     sal_Int32                           mnLastPageCount;
     ResStringArray                      maLocalizedStrings;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    vcl::PrinterController*             mpController;
-    NSPrintOperation*                   mpOp;
-    PrintAccessoryViewState*            mpState;
-    NSBox*                              mpPreviewBox;
-    NSImageView*                        mpPreview;  // print preview is not provided "by default"
-    NSView*                             mpAccessoryView;
-    NSTabView*                          mpTabView;
-    NSTextField*                        mpPageEdit;
-    NSStepper*                          mpStepper;
-#else
     AquaPrintPanelAccessoryController*  mpAccessoryController;
-#endif
 
 public:
-    ControllerProperties(
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-                          vcl::PrinterController* i_pController
-                        , NSPrintOperation* i_pOp
-                        , PrintAccessoryViewState* i_pState
-                        , NSView* i_pAccessoryView
-                        , NSTabView* i_pTabView
-#else
-                          AquaPrintPanelAccessoryController* i_pAccessoryController
-#endif
-                         )
+    ControllerProperties( AquaPrintPanelAccessoryController* i_pAccessoryController )
     : mnNextTag( 0 )
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    , mnLastPageCount( i_pController->getFilteredPageCount() )
-    , mpController( i_pController )
-    , mpOp( i_pOp )
-    , mpState( i_pState )
-    , mpPreviewBox( nil )
-    , mpPreview( nil )
-    , mpAccessoryView( i_pAccessoryView )
-    , mpTabView( i_pTabView )
-    , mpPageEdit( nil )
-    , mpStepper( nil )
-#else
     , mnLastPageCount( [i_pAccessoryController printerController]->getFilteredPageCount() )
-#endif
     , maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
     , mpAccessoryController( i_pAccessoryController )
-#endif
     {
         assert( maLocalizedStrings.Count() >= 5 && "resources not found" );
     }
@@ -237,47 +183,6 @@ public:
                : OUString( "Print selection only" );
     }
 
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    void updatePrintJob()
-    {
-        // page range may be changed by option choice
-        sal_Int32 nPages = mpController->getFilteredPageCount();
-
-        mpState->bNeedRestart = false;
-        if( nPages != mnLastPageCount )
-        {
-            #if OSL_DEBUG_LEVEL > 1
-            SAL_INFO( "vcl.osx.print", "number of pages changed" <<
-                      " from " << mnLastPageCount << " to " << nPages );
-            #endif
-            mpState->bNeedRestart = true;
-        }
-        mnLastPageCount = nPages;
-
-        NSTabViewItem* pItem = [mpTabView selectedTabViewItem];
-        if( pItem )
-            mpState->nLastPage = [mpTabView indexOfTabViewItem: pItem];
-        else
-            mpState->nLastPage = 0;
-
-        if( mpState->bNeedRestart )
-        {
-            // AppKit does not give a chance of changing the page count
-            // and don't let cancel the dialog either
-            // hack: send a cancel message to the modal window displaying views
-            NSWindow* pNSWindow = [NSApp modalWindow];
-            if( pNSWindow )
-                [pNSWindow cancelOperation: nil];
-            [[mpOp printInfo] setJobDisposition: NSPrintCancelJob];
-        }
-        else
-        {
-            sal_Int32 nPage = [mpStepper intValue];
-            updatePreviewImage( nPage-1 );
-        }
-    }
-#endif
-
     int addNameTag( const rtl::OUString& i_rPropertyName )
     {
         int nNewTag = mnNextTag++;
@@ -319,18 +224,12 @@ public:
         std::map< int, sal_Int32 >::const_iterator value_it = maTagToValueInt.find( i_nTag );
         if( name_it != maTagToPropertyName.end() && value_it != maTagToValueInt.end() )
         {
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
             vcl::PrinterController * mpController = [mpAccessoryController printerController];
-#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= value_it->second;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-                updatePrintJob();
-#else
                 mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
-#endif
             }
         }
     }
@@ -340,18 +239,12 @@ public:
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
             vcl::PrinterController * mpController = [mpAccessoryController printerController];
-#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= i_nValue;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-                updatePrintJob();
-#else
                 mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
-#endif
             }
         }
     }
@@ -361,9 +254,7 @@ public:
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
             vcl::PrinterController * mpController = [mpAccessoryController printerController];
-#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
@@ -372,11 +263,8 @@ public:
                    pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
                else
                    pVal->Value <<= i_bValue;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-                updatePrintJob();
-#else
+
                 mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
-#endif
             }
         }
     }
@@ -386,18 +274,12 @@ public:
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
             vcl::PrinterController * mpController = [mpAccessoryController printerController];
-#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= i_rValue;
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-                updatePrintJob();
-#else
                 mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
-#endif
             }
         }
     }
@@ -421,9 +303,7 @@ public:
             std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
             if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PrintContent")) )
             {
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
                 vcl::PrinterController * mpController = [mpAccessoryController printerController];
-#endif
                 BOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
                 if( pCtrl )
                 {
@@ -438,166 +318,6 @@ public:
         }
     }
 
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-
-    void updatePreviewImage( sal_Int32 i_nPage )
-    {
-        sal_Int32 nPages = mpController->getFilteredPageCount();
-        NSRect aViewFrame = [mpPreview frame];
-        Size aPixelSize( static_cast<long>(aViewFrame.size.width),
-                         static_cast<long>(aViewFrame.size.height) );
-        if( i_nPage >= 0 && nPages > i_nPage )
-        {
-            GDIMetaFile aMtf;
-            PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf ) );
-            auto aDev(VclPtr<VirtualDevice>::Create());
-            if( mpController->getPrinter()->GetPrinterOptions().IsConvertToGreyscales() )
-                aDev->SetDrawMode( aDev->GetDrawMode() | ( DrawModeFlags::GrayLine | DrawModeFlags::GrayFill | DrawModeFlags::GrayText | 
-                                                         DrawModeFlags::GrayBitmap | DrawModeFlags::GrayGradient ) );
-            // see salprn.cxx, currently we pretend to be a 720dpi device on printers
-            aDev->SetReferenceDevice( 720, 720 );
-            aDev->EnableOutput();
-            Size aLogicSize( aDev->PixelToLogic( aPixelSize, MapMode( MAP_100TH_MM ) ) );
-            double fScaleX = double(aLogicSize.Width())/double(aPageSize.aSize.Width());
-            double fScaleY = double(aLogicSize.Height())/double(aPageSize.aSize.Height());
-            double fScale = (fScaleX < fScaleY) ? fScaleX : fScaleY;
-            // #i104784# if we render the page too small then rounding issues result in
-            // layout artifacts looking really bad. So scale the page unto a device that is not
-            // full page size but not too small either. This also results in much better visual
-            // quality of the preview, e.g. when its height approaches the number of text lines
-            if( fScale < 0.1 )
-                fScale = 0.1;
-            aMtf.WindStart();
-            aMtf.Scale( fScale, fScale );
-            aMtf.WindStart();
-            aLogicSize.Width() = long(double(aPageSize.aSize.Width()) * fScale);
-            aLogicSize.Height() = long(double(aPageSize.aSize.Height()) * fScale);
-            aPixelSize = aDev->LogicToPixel( aLogicSize, MapMode( MAP_100TH_MM ) );
-            aDev->SetOutputSizePixel( aPixelSize );
-            aMtf.WindStart();
-            aDev->SetMapMode( MapMode( MAP_100TH_MM ) );
-            aMtf.Play( aDev.get(), Point( 0, 0 ), aLogicSize );
-            aDev->EnableMapMode( FALSE );
-            Image aImage( aDev->GetBitmap( Point( 0, 0 ), aPixelSize ) );
-            NSImage* pImage = CreateNSImage( aImage );
-            [mpPreview setImage: [pImage autorelease]];
-        }
-        else
-            [mpPreview setImage: nil];
-    }
-
-    void setupPreview( ControlTarget* i_pCtrlTarget )
-    {
-        if( maLocalizedStrings.Count() < 3 )
-            return;
-
-        // get the preview control
-        NSRect aPreviewFrame = [mpAccessoryView frame];
-        aPreviewFrame.origin.x = 0;
-        aPreviewFrame.origin.y = 5;
-        aPreviewFrame.size.width = 190;
-        aPreviewFrame.size.height -= 7;
-
-        // create a box to put the preview controls in
-        mpPreviewBox = [[NSBox alloc] initWithFrame: aPreviewFrame];
-        [mpPreviewBox setTitle: [CreateNSString( maLocalizedStrings.GetString( 0 ) ) autorelease]];
-        [mpAccessoryView addSubview: [mpPreviewBox autorelease]];
-
-        // now create the image view of the preview
-        NSSize aMargins = [mpPreviewBox contentViewMargins];
-        aPreviewFrame.origin.x = 0;
-        aPreviewFrame.origin.y = 34;
-        aPreviewFrame.size.width -= 2*(aMargins.width+1);
-        aPreviewFrame.size.height -= 61;
-        mpPreview = [[NSImageView alloc] initWithFrame: aPreviewFrame];
-        [mpPreview setImageScaling: NSImageScaleProportionallyDown];
-        [mpPreview setImageAlignment: NSImageAlignCenter];
-        [mpPreview setImageFrameStyle: NSImageFrameNone];
-        [mpPreviewBox addSubview: [mpPreview autorelease]];
-
-        // add a label
-        sal_Int32 nPages = mpController->getFilteredPageCount();
-        rtl::OUStringBuffer aBuf( 16 );
-        aBuf.append( "/ " );
-        aBuf.append( rtl::OUString::number( nPages ) );
-
-        NSString* pText = CreateNSString( aBuf.makeStringAndClear() );
-        NSRect aTextRect = { { 100, 5 }, { 100, 22 } };
-        NSTextView* aPagesLabel = [[NSTextView alloc] initWithFrame: aTextRect];
-        [aPagesLabel setFont: [NSFont controlContentFontOfSize: 0]];
-        [aPagesLabel setEditable: NO];
-        [aPagesLabel setSelectable: NO];
-        [aPagesLabel setDrawsBackground: NO];
-        [aPagesLabel setString: [pText autorelease]];
-        [aPagesLabel setToolTip: [CreateNSString( maLocalizedStrings.GetString( 2 ) ) autorelease]];
-        [mpPreviewBox addSubview: [aPagesLabel autorelease]];
-
-        NSRect aFieldRect = { { 45, 5 }, { 35, 25 } };
-        mpPageEdit = [[NSTextField alloc] initWithFrame: aFieldRect];
-        [mpPageEdit setEditable: YES];
-        [mpPageEdit setSelectable: YES];
-        [mpPageEdit setDrawsBackground: YES];
-        [mpPageEdit setToolTip: [CreateNSString( maLocalizedStrings.GetString( 1 ) ) autorelease]];
-        [mpPreviewBox addSubview: [mpPageEdit autorelease]];
-
-        // add a stepper control
-        NSRect aStepFrame = { { 85, 5 }, { 15, 25 } };
-        mpStepper = [[NSStepper alloc] initWithFrame: aStepFrame];
-        [mpStepper setIncrement: 1];
-        [mpStepper setValueWraps: NO];
-        [mpPreviewBox addSubview: [mpStepper autorelease]];
-
-        // constrain the text field to decimal numbers
-        NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
-        [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
-        [pFormatter setMinimum: [[NSNumber numberWithInt: 1] autorelease]];
-        [pFormatter setMaximum: [[NSNumber numberWithInt: nPages] autorelease]];
-        [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
-        [pFormatter setAllowsFloats: NO];
-        [pFormatter setMaximumFractionDigits: 0];
-        [mpPageEdit setFormatter: pFormatter];
-        [mpStepper setMinValue: 1];
-        [mpStepper setMaxValue: nPages];
-
-        [mpPageEdit setIntValue: 1];
-        [mpStepper setIntValue: 1];
-
-        // connect target and action
-        [mpStepper setTarget: i_pCtrlTarget];
-        [mpStepper setAction: @selector(triggeredPreview:)];
-        [mpPageEdit setTarget: i_pCtrlTarget];
-        [mpPageEdit setAction: @selector(triggeredPreview:)];
-
-        // set first preview image
-        updatePreviewImage( 0 );
-    }
-
-    void changePreview( NSObject* i_pSender )
-    {
-        if( [i_pSender isMemberOfClass: [NSTextField class]] )
-        {
-            NSTextField* pField = (NSTextField*)i_pSender;
-            if( pField == mpPageEdit ) // sanity check
-            {
-                sal_Int32 nPage = [pField intValue];
-                [mpStepper setIntValue: nPage];
-                updatePreviewImage( nPage-1 );
-            }
-        }
-        else if( [i_pSender isMemberOfClass: [NSStepper class]] )
-        {
-            NSStepper* pStepper = (NSStepper*)i_pSender;
-            if( pStepper == mpStepper ) // sanity check
-            {
-                sal_Int32 nPage = [pStepper intValue];
-                [mpPageEdit setIntValue: nPage];
-                updatePreviewImage( nPage-1 );
-            }
-        }
-    }
-
-#endif
-
 };
 
 static OUString filterAccelerator( rtl::OUString const & rText )
@@ -696,13 +416,6 @@ static OUString filterAccelerator( rtl::OUString const & rText )
     mpController->updateEnableState();
 }
 
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
--(void)triggeredPreview:(id)pSender
-{
-    mpController->changePreview( pSender );
-}
-#endif
-
 -(void)dealloc
 {
     delete mpController;
@@ -1257,17 +970,12 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
         return nil;
 
     NSRect aViewFrame = { NSZeroPoint, { 600, 400 } };
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    NSRect aTabViewFrame = { { 190, 0 }, { 410, 400 } };
-#else
     NSRect aTabViewFrame = aViewFrame;
-#endif
 
     NSView* pAccessoryView = [[NSView alloc] initWithFrame: aViewFrame];
     NSTabView* pTabView = [[NSTabView alloc] initWithFrame: aTabViewFrame];
     [pAccessoryView addSubview: [pTabView autorelease]];
 
-#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
     // create the accessory controller
     AquaPrintPanelAccessoryController* pAccessoryController =
             [[AquaPrintPanelAccessoryController alloc] initWithNibName: nil bundle: nil];
@@ -1275,19 +983,13 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     [pAccessoryController forPrintOperation: pOp];
     [pAccessoryController withPrinterController: pController];
     [pAccessoryController withViewState: pState];
-#endif
 
     NSView* pCurParent = 0;
     long nCurY = 0;
     long nCurX = 0;
     NSSize aMaxTabSize = NSZeroSize;
 
-    ControllerProperties* pControllerProperties =
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-            new ControllerProperties( pController, pOp, pState, pAccessoryView, pTabView );
-#else
-            new ControllerProperties( pAccessoryController );
-#endif
+    ControllerProperties* pControllerProperties = new ControllerProperties( pAccessoryController );
     ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
 
     std::vector< ColumnItem > aLeftColumn, aRightColumn;
@@ -1529,12 +1231,6 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     pControllerProperties->updateEnableState();
     adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
 
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    // leave some space for preview
-    if( aMaxTabSize.height < 200 )
-        aMaxTabSize.height = 200;
-#endif
-
     // now reposition everything again so it is upper bound
     adjustTabViews( pTabView, aMaxTabSize );
 
@@ -1548,20 +1244,11 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     aViewFrame.size.height = aTabCtrlSize.height + aTabViewFrame.origin.y;
     [pAccessoryView setFrameSize: aViewFrame.size];
 
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    pControllerProperties->setupPreview( pCtrlTarget );
-#endif
-
-#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
-    // set the accessory view
-    [pOp setAccessoryView: [pAccessoryView autorelease]];
-#else // -(void)setAccessoryView:(NSView *)aView of NSPrintOperation is deprecated since 10.5
     // get the print panel
     NSPrintPanel* pPrintPanel = [pOp printPanel];
     [pPrintPanel setOptions: [pPrintPanel options] | NSPrintPanelShowsPreview];
     // add the accessory controller to the panel
     [pPrintPanel addAccessoryController: [pAccessoryController autorelease]];
-#endif
 
     // set the current selecte tab item
     if( pState->nLastPage >= 0 && pState->nLastPage < [pTabView numberOfTabViewItems] )
commit 4dc45d16e1d3610ce71ee2fb9c95fab13b970374
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Sun Oct 18 11:29:49 2015 -0400

    vcl.osx.print: convert to use modern API for print dialog
    
    Change-Id: Icc7d7ad95d1ffbf55f1cd704148f3ceb58618e6c

diff --git a/vcl/inc/osx/printview.h b/vcl/inc/osx/printview.h
index b63900b..ef8b891 100644
--- a/vcl/inc/osx/printview.h
+++ b/vcl/inc/osx/printview.h
@@ -45,7 +45,8 @@ struct PrintAccessoryViewState
     vcl::PrinterController*     mpController;
     AquaSalInfoPrinter*         mpInfoPrinter;
 }
--(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
+-(id)initWithController: (vcl::PrinterController*)pController
+        withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
 -(BOOL)knowsPageRange: (NSRangePointer)range;
 -(NSRect)rectForPage: (int)page;
 -(NSPoint)locationOfPrintRect: (NSRect)aRect;
@@ -55,7 +56,9 @@ struct PrintAccessoryViewState
 @interface AquaPrintAccessoryView : NSObject
 {
 }
-+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp
+               withController: (vcl::PrinterController*)pController
+                    withState: (PrintAccessoryViewState*)pState;
 @end
 
 #endif // INCLUDED_VCL_INC_OSX_PRINTVIEW_H
diff --git a/vcl/osx/printaccessoryview.mm b/vcl/osx/printaccessoryview.mm
index d03d4f4..80d972e 100644
--- a/vcl/osx/printaccessoryview.mm
+++ b/vcl/osx/printaccessoryview.mm
@@ -45,11 +45,15 @@ using namespace com::sun::star;
 using namespace com::sun::star::beans;
 using namespace com::sun::star::uno;
 
-/* Note: the accessory view as implemented here is already deprecated in Leopard. Unfortunately
-   as long as our baseline is Tiger we cannot gain the advantages over multiple accessory views
-   as well havs having accessory views AND a preview (as long as you are linked vs. 10.4 libraries
-   the preview insists on not being present. This is unfortunate.
-*/
+#if MACOSX_SDK_VERSION <= 1040
+// as long as you are linking with 10.4 libraries there's no preview
+# define VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+#  undef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+#else
+// since 10.5 you can use multiple accessory views and have accessory views and a preview
+# define MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+#  undef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+#endif
 
 class ControllerProperties;
 
@@ -60,93 +64,207 @@ class ControllerProperties;
 -(id)initWithControllerMap: (ControllerProperties*)pController;
 -(void)triggered:(id)pSender;
 -(void)triggeredNumeric:(id)pSender;
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
 -(void)triggeredPreview:(id)pSender;
+#endif
 -(void)dealloc;
 @end
 
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+
+ at interface AquaPrintPanelAccessoryController : NSViewController< NSPrintPanelAccessorizing >
+{
+    NSPrintOperation *mpPrintOperation;
+    vcl::PrinterController *mpPrinterController;
+    PrintAccessoryViewState *mpViewState;
+}
+
+-(void)forPrintOperation:(NSPrintOperation*)pPrintOp;
+-(void)withPrinterController:(vcl::PrinterController*)pController;
+-(void)withViewState:(PrintAccessoryViewState*)pState;
+
+-(NSPrintOperation*)printOperation;
+-(vcl::PrinterController*)printerController;
+-(PrintAccessoryViewState*)viewState;
+
+-(NSSet*)keyPathsForValuesAffectingPreview;
+-(NSArray*)localizedSummaryItems;
+
+-(sal_Int32)updatePrintOperation:(sal_Int32)pLastPageCount;
+
+ at end
+
+ at implementation AquaPrintPanelAccessoryController
+
+-(void)forPrintOperation:(NSPrintOperation*)pPrintOp
+    { mpPrintOperation = pPrintOp; }
+
+-(void)withPrinterController:(vcl::PrinterController*)pController
+    { mpPrinterController = pController; }
+
+-(void)withViewState:(PrintAccessoryViewState*)pState
+    { mpViewState = pState; }
+
+-(NSPrintOperation*)printOperation
+    { return mpPrintOperation; }
+
+-(vcl::PrinterController*)printerController
+    { return mpPrinterController; }
+
+-(PrintAccessoryViewState*)viewState
+    { return mpViewState; }
+
+-(NSSet*)keyPathsForValuesAffectingPreview
+{
+    return [ NSSet setWithObject:@"updatePrintOperation" ];
+}
+
+-(NSArray*)localizedSummaryItems
+{
+    return [ NSArray arrayWithObject:
+               [ NSDictionary dictionary ] ];
+}
+
+-(sal_Int32)updatePrintOperation:(sal_Int32)pLastPageCount
+{
+    // page range may be changed by option choice
+    sal_Int32 nPages = mpPrinterController->getFilteredPageCount();
+
+    mpViewState->bNeedRestart = false;
+    if( nPages != pLastPageCount )
+    {
+        #if OSL_DEBUG_LEVEL > 1
+        SAL_INFO( "vcl.osx.print", "number of pages changed" <<
+                  " from " << pLastPageCount << " to " << nPages );
+        #endif
+        mpViewState->bNeedRestart = true;
+    }
+
+    NSTabView* pTabView = [[[self view] subviews] objectAtIndex:0];
+    NSTabViewItem* pItem = [pTabView selectedTabViewItem];
+    if( pItem )
+        mpViewState->nLastPage = [pTabView indexOfTabViewItem: pItem];
+    else
+        mpViewState->nLastPage = 0;
+
+    if( mpViewState->bNeedRestart )
+    {
+        // AppKit does not give a chance of changing the page count
+        // and don't let cancel the dialog either
+        // hack: send a cancel message to the modal window displaying views
+        NSWindow* pNSWindow = [NSApp modalWindow];
+        if( pNSWindow )
+            [pNSWindow cancelOperation: nil];
+        [[mpPrintOperation printInfo] setJobDisposition: NSPrintCancelJob];
+    }
+
+    return nPages;
+}
+
+ at end
+
+#endif
 
 class ControllerProperties
 {
-    vcl::PrinterController*             mpController;
     std::map< int, rtl::OUString >      maTagToPropertyName;
     std::map< int, sal_Int32 >          maTagToValueInt;
     std::map< NSView*, NSView* >        maViewPairMap;
     std::vector< NSObject* >            maViews;
     int                                 mnNextTag;
     sal_Int32                           mnLastPageCount;
-    PrintAccessoryViewState*            mpState;
+    ResStringArray                      maLocalizedStrings;
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+    vcl::PrinterController*             mpController;
     NSPrintOperation*                   mpOp;
+    PrintAccessoryViewState*            mpState;
+    NSBox*                              mpPreviewBox;
+    NSImageView*                        mpPreview;  // print preview is not provided "by default"
     NSView*                             mpAccessoryView;
     NSTabView*                          mpTabView;
-    NSBox*                              mpPreviewBox;
-    NSImageView*                        mpPreview;
     NSTextField*                        mpPageEdit;
     NSStepper*                          mpStepper;
-    NSTextView*                         mpPagesLabel;
-    ResStringArray                      maLocalizedStrings;        
-
-    public:
-    ControllerProperties( vcl::PrinterController* i_pController,
-                          NSPrintOperation* i_pOp,
-                          NSView* i_pAccessoryView,
-                          NSTabView* i_pTabView,
-                          PrintAccessoryViewState* i_pState )
-    : mpController( i_pController ),
-      mnNextTag( 0 ),
-      mnLastPageCount( i_pController->getFilteredPageCount() ),
-      mpState( i_pState ),
-      mpOp( i_pOp ),
-      mpAccessoryView( i_pAccessoryView ),
-      mpTabView( i_pTabView ),
-      mpPreviewBox( nil ),
-      mpPreview( nil ),
-      mpPageEdit( nil ),
-      mpStepper( nil ),
-      mpPagesLabel( nil ),
-      maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
+#else
+    AquaPrintPanelAccessoryController*  mpAccessoryController;
+#endif
+
+public:
+    ControllerProperties(
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+                          vcl::PrinterController* i_pController
+                        , NSPrintOperation* i_pOp
+                        , PrintAccessoryViewState* i_pState
+                        , NSView* i_pAccessoryView
+                        , NSTabView* i_pTabView
+#else
+                          AquaPrintPanelAccessoryController* i_pAccessoryController
+#endif
+                         )
+    : mnNextTag( 0 )
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+    , mnLastPageCount( i_pController->getFilteredPageCount() )
+    , mpController( i_pController )
+    , mpOp( i_pOp )
+    , mpState( i_pState )
+    , mpPreviewBox( nil )
+    , mpPreview( nil )
+    , mpAccessoryView( i_pAccessoryView )
+    , mpTabView( i_pTabView )
+    , mpPageEdit( nil )
+    , mpStepper( nil )
+#else
+    , mnLastPageCount( [i_pAccessoryController printerController]->getFilteredPageCount() )
+#endif
+    , maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+    , mpAccessoryController( i_pAccessoryController )
+#endif
     {
-        mpState->bNeedRestart = false;
-        DBG_ASSERT( maLocalizedStrings.Count() >= 5, "resources not found !" );
+        assert( maLocalizedStrings.Count() >= 5 && "resources not found" );
     }
-    
+
     rtl::OUString getMoreString()
     {
         return maLocalizedStrings.Count() >= 4
                ? OUString( maLocalizedStrings.GetString( 3 ) )
                : OUString( "More" );
     }
-    
+
     rtl::OUString getPrintSelectionString()
     {
         return maLocalizedStrings.Count() >= 5
                ? OUString( maLocalizedStrings.GetString( 4 ) )
                : OUString( "Print selection only" );
     }
-    
+
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
     void updatePrintJob()
     {
-        // TODO: refresh page count etc from mpController 
-
-        // page range may have changed depending on options
+        // page range may be changed by option choice
         sal_Int32 nPages = mpController->getFilteredPageCount();
-        #if OSL_DEBUG_LEVEL > 1
+
+        mpState->bNeedRestart = false;
         if( nPages != mnLastPageCount )
-            fprintf( stderr, "trouble: number of pages changed from %ld to %ld !\n", mnLastPageCount, nPages );
-        #endif
-        mpState->bNeedRestart = (nPages != mnLastPageCount);
+        {
+            #if OSL_DEBUG_LEVEL > 1
+            SAL_INFO( "vcl.osx.print", "number of pages changed" <<
+                      " from " << mnLastPageCount << " to " << nPages );
+            #endif
+            mpState->bNeedRestart = true;
+        }
+        mnLastPageCount = nPages;
+
         NSTabViewItem* pItem = [mpTabView selectedTabViewItem];
         if( pItem )
             mpState->nLastPage = [mpTabView indexOfTabViewItem: pItem];
         else
             mpState->nLastPage = 0;
-        mnLastPageCount = nPages;
+
         if( mpState->bNeedRestart )
         {
-            // Warning: bad hack ahead
-            // Apple does not give us a chance of changing the page count,
-            // and they don't let us cancel the dialog either
-            // hack: send a cancel message to the window displaying our views.
-            // this is ugly.
+            // AppKit does not give a chance of changing the page count
+            // and don't let cancel the dialog either
+            // hack: send a cancel message to the modal window displaying views
             NSWindow* pNSWindow = [NSApp modalWindow];
             if( pNSWindow )
                 [pNSWindow cancelOperation: nil];
@@ -158,7 +276,8 @@ class ControllerProperties
             updatePreviewImage( nPage-1 );
         }
     }
-    
+#endif
+
     int addNameTag( const rtl::OUString& i_rPropertyName )
     {
         int nNewTag = mnNextTag++;
@@ -173,18 +292,18 @@ class ControllerProperties
         maTagToValueInt[ nNewTag ] = i_nValue;
         return nNewTag;
     }
-    
+
     void addObservedControl( NSObject* i_pView )
     {
         maViews.push_back( i_pView );
     }
-    
+
     void addViewPair( NSView* i_pLeft, NSView* i_pRight )
     {
         maViewPairMap[ i_pLeft ] = i_pRight;
         maViewPairMap[ i_pRight ] = i_pLeft;
     }
-    
+
     NSView* getPair( NSView* i_pLeft ) const
     {
         NSView* pRight = nil;
@@ -193,18 +312,25 @@ class ControllerProperties
             pRight = it->second;
         return pRight;
     }
-    
+
     void changePropertyWithIntValue( int i_nTag )
     {
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         std::map< int, sal_Int32 >::const_iterator value_it = maTagToValueInt.find( i_nTag );
         if( name_it != maTagToPropertyName.end() && value_it != maTagToValueInt.end() )
         {
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+            vcl::PrinterController * mpController = [mpAccessoryController printerController];
+#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= value_it->second;
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
                 updatePrintJob();
+#else
+                mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
+#endif
             }
         }
     }
@@ -214,20 +340,30 @@ class ControllerProperties
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+            vcl::PrinterController * mpController = [mpAccessoryController printerController];
+#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= i_nValue;
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
                 updatePrintJob();
+#else
+                mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
+#endif
             }
         }
     }
-    
+
     void changePropertyWithBoolValue( int i_nTag, bool i_bValue )
     {
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+            vcl::PrinterController * mpController = [mpAccessoryController printerController];
+#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
@@ -236,25 +372,36 @@ class ControllerProperties
                    pVal->Value <<= i_bValue ? sal_Int32(2) : sal_Int32(0);
                else
                    pVal->Value <<= i_bValue;
-                updatePrintJob(); 
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+                updatePrintJob();
+#else
+                mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
+#endif
             }
         }
     }
-    
+
     void changePropertyWithStringValue( int i_nTag, const rtl::OUString& i_rValue )
     {
         std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
         if( name_it != maTagToPropertyName.end() )
         {
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+            vcl::PrinterController * mpController = [mpAccessoryController printerController];
+#endif
             PropertyValue* pVal = mpController->getValue( name_it->second );
             if( pVal )
             {
                 pVal->Value <<= i_rValue;
-                updatePrintJob(); 
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+                updatePrintJob();
+#else
+                mnLastPageCount = [mpAccessoryController updatePrintOperation: mnLastPageCount];
+#endif
             }
         }
     }
-    
+
     void updateEnableState()
     {
         for( std::vector< NSObject* >::iterator it = maViews.begin(); it != maViews.end(); ++it )
@@ -266,14 +413,17 @@ class ControllerProperties
                 pCtrl = (NSControl*)pObj;
             else if( [pObj isKindOfClass: [NSCell class]] )
                 pCell = (NSCell*)pObj;
-            
+
             int nTag = pCtrl ? [pCtrl tag] :
                        pCell ? [pCell tag] :
                        -1;
-            
+
             std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
             if( name_it != maTagToPropertyName.end() && ! name_it->second.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PrintContent")) )
             {
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+                vcl::PrinterController * mpController = [mpAccessoryController printerController];
+#endif
                 BOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
                 if( pCtrl )
                 {
@@ -284,11 +434,12 @@ class ControllerProperties
                 }
                 else if( pCell )
                     [pCell setEnabled: bEnabled];
-                
             }
         }
     }
-    
+
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+
     void updatePreviewImage( sal_Int32 i_nPage )
     {
         sal_Int32 nPages = mpController->getFilteredPageCount();
@@ -339,7 +490,7 @@ class ControllerProperties
     {
         if( maLocalizedStrings.Count() < 3 )
             return;
-        
+
         // get the preview control
         NSRect aPreviewFrame = [mpAccessoryView frame];
         aPreviewFrame.origin.x = 0;
@@ -363,24 +514,24 @@ class ControllerProperties
         [mpPreview setImageAlignment: NSImageAlignCenter];
         [mpPreview setImageFrameStyle: NSImageFrameNone];
         [mpPreviewBox addSubview: [mpPreview autorelease]];
-    
+
         // add a label
         sal_Int32 nPages = mpController->getFilteredPageCount();
         rtl::OUStringBuffer aBuf( 16 );
         aBuf.append( "/ " );
         aBuf.append( rtl::OUString::number( nPages ) );
-    
+
         NSString* pText = CreateNSString( aBuf.makeStringAndClear() );
         NSRect aTextRect = { { 100, 5 }, { 100, 22 } };
-        mpPagesLabel = [[NSTextView alloc] initWithFrame: aTextRect];
-        [mpPagesLabel setFont: [NSFont controlContentFontOfSize: 0]];
-        [mpPagesLabel setEditable: NO];
-        [mpPagesLabel setSelectable: NO];
-        [mpPagesLabel setDrawsBackground: NO];
-        [mpPagesLabel setString: [pText autorelease]];
-        [mpPagesLabel setToolTip: [CreateNSString( maLocalizedStrings.GetString( 2 ) ) autorelease]];
-        [mpPreviewBox addSubview: [mpPagesLabel autorelease]];
-    
+        NSTextView* aPagesLabel = [[NSTextView alloc] initWithFrame: aTextRect];
+        [aPagesLabel setFont: [NSFont controlContentFontOfSize: 0]];
+        [aPagesLabel setEditable: NO];
+        [aPagesLabel setSelectable: NO];
+        [aPagesLabel setDrawsBackground: NO];
+        [aPagesLabel setString: [pText autorelease]];
+        [aPagesLabel setToolTip: [CreateNSString( maLocalizedStrings.GetString( 2 ) ) autorelease]];
+        [mpPreviewBox addSubview: [aPagesLabel autorelease]];
+
         NSRect aFieldRect = { { 45, 5 }, { 35, 25 } };
         mpPageEdit = [[NSTextField alloc] initWithFrame: aFieldRect];
         [mpPageEdit setEditable: YES];
@@ -388,14 +539,14 @@ class ControllerProperties
         [mpPageEdit setDrawsBackground: YES];
         [mpPageEdit setToolTip: [CreateNSString( maLocalizedStrings.GetString( 1 ) ) autorelease]];
         [mpPreviewBox addSubview: [mpPageEdit autorelease]];
-    
+
         // add a stepper control
         NSRect aStepFrame = { { 85, 5 }, { 15, 25 } };
         mpStepper = [[NSStepper alloc] initWithFrame: aStepFrame];
         [mpStepper setIncrement: 1];
         [mpStepper setValueWraps: NO];
         [mpPreviewBox addSubview: [mpStepper autorelease]];
-                        
+
         // constrain the text field to decimal numbers
         NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
         [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
@@ -407,20 +558,20 @@ class ControllerProperties
         [mpPageEdit setFormatter: pFormatter];
         [mpStepper setMinValue: 1];
         [mpStepper setMaxValue: nPages];
-    
+
         [mpPageEdit setIntValue: 1];
         [mpStepper setIntValue: 1];
-    
+
         // connect target and action
         [mpStepper setTarget: i_pCtrlTarget];
         [mpStepper setAction: @selector(triggeredPreview:)];
         [mpPageEdit setTarget: i_pCtrlTarget];
         [mpPageEdit setAction: @selector(triggeredPreview:)];
-        
+
         // set first preview image
         updatePreviewImage( 0 );
     }
-    
+
     void changePreview( NSObject* i_pSender )
     {
         if( [i_pSender isMemberOfClass: [NSTextField class]] )
@@ -444,6 +595,9 @@ class ControllerProperties
             }
         }
     }
+
+#endif
+
 };
 
 static OUString filterAccelerator( rtl::OUString const & rText )
@@ -455,14 +609,16 @@ static OUString filterAccelerator( rtl::OUString const & rText )
 }
 
 @implementation ControlTarget
+
 -(id)initWithControllerMap: (ControllerProperties*)pController
 {
     if( (self = [super init]) )
     {
-        mpController = pController; 
+        mpController = pController;
     }
     return self;
 }
+
 -(void)triggered:(id)pSender
 {
     if( [pSender isMemberOfClass: [NSPopUpButton class]] )
@@ -500,10 +656,12 @@ static OUString filterAccelerator( rtl::OUString const & rText )
     }
     else
     {
-        SAL_INFO( "vcl.osx.print", "Unsupported class" << ([pSender class] ? [NSStringFromClass([pSender class]) UTF8String] : "nil"));
+        SAL_INFO( "vcl.osx.print", "Unsupported class" <<
+                  ( [pSender class] ? [NSStringFromClass([pSender class]) UTF8String] : "nil" ) );
     }
     mpController->updateEnableState();
 }
+
 -(void)triggeredNumeric:(id)pSender
 {
     if( [pSender isMemberOfClass: [NSTextField class]] )
@@ -532,19 +690,25 @@ static OUString filterAccelerator( rtl::OUString const & rText )
     }
     else
     {
-        SAL_INFO( "vcl.osx.print", "Unsupported class" << ([pSender class] ? [NSStringFromClass([pSender class]) UTF8String] : "nil"));
+        SAL_INFO( "vcl.osx.print", "Unsupported class" <<
+                  ([pSender class] ? [NSStringFromClass([pSender class]) UTF8String] : "nil") );
     }
     mpController->updateEnableState();
 }
+
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
 -(void)triggeredPreview:(id)pSender
 {
     mpController->changePreview( pSender );
 }
+#endif
+
 -(void)dealloc
 {
     delete mpController;
     [super dealloc];
 }
+
 @end
 
 struct ColumnItem
@@ -584,7 +748,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
                                   )
 {
     // balance columns
-    
+
     // first get overall column widths
     long nLeftWidth = 0;
     long nRightWidth = 0;
@@ -600,7 +764,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
         if( nW > nRightWidth )
             nRightWidth = nW;
     }
-    
+
     // right align left column
     for( size_t i = 0; i < rLeftColumn.size(); i++ )
     {
@@ -637,7 +801,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
             [rRightColumn[i].pControl setFrame: aCtrlRect];
         }
     }
-    
+
     NSArray* pSubViews = [pNSView subviews];
     unsigned int nViews = [pSubViews count];
     NSRect aUnion = NSZeroRect;
@@ -647,7 +811,7 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
     {
         aUnion = NSUnionRect( aUnion, [[pSubViews objectAtIndex: n] frame] );
     }
-    
+
     // move everything so it will fit
     for( unsigned int n = 0; n < nViews; n++ )
     {
@@ -657,12 +821,12 @@ static void adjustViewAndChildren( NSView* pNSView, NSSize& rMaxSize,
         aFrame.origin.y -= aUnion.origin.y - 5;
         [pCurSubView setFrame: aFrame];
     }
-    
+
     // resize the view itself
     aUnion.size.height += 10;
     aUnion.size.width += 20;
     [pNSView setFrameSize: aUnion.size];
-    
+
     if( aUnion.size.width > rMaxSize.width )
         rMaxSize.width = aUnion.size.width;
     if( aUnion.size.height > rMaxSize.height )
@@ -728,10 +892,11 @@ static sal_Int32 findBreak( const rtl::OUString& i_rText, sal_Int32 i_nPos )
     Reference< i18n::XBreakIterator > xBI( vcl::unohelper::CreateBreakIterator() );
     if( xBI.is() )
     {
-        i18n::Boundary aBoundary = xBI->getWordBoundary( i_rText, i_nPos,
-                                                         Application::GetSettings().GetLanguageTag().getLocale(),
-                                                         i18n::WordType::ANYWORD_IGNOREWHITESPACES,
-                                                         sal_True );
+        i18n::Boundary aBoundary =
+                xBI->getWordBoundary( i_rText, i_nPos,
+                                      Application::GetSettings().GetLanguageTag().getLocale(),
+                                      i18n::WordType::ANYWORD_IGNOREWHITESPACES,
+                                      true );
         nRet = aBoundary.endPos;
     }
     return nRet;
@@ -855,7 +1020,9 @@ static void addRadio( NSView* pCurParent, long& rCurX, long& rCurY, long nAttach
     // setup radio matrix
     NSButtonCell* pProto = [[NSButtonCell alloc] init];
     
-    NSRect aRadioRect = { { static_cast<CGFloat>(rCurX + nOff), 0 }, { static_cast<CGFloat>(280 - rCurX), static_cast<CGFloat>(5*rChoices.getLength()) } };
+    NSRect aRadioRect = { { static_cast<CGFloat>(rCurX + nOff), 0 },
+                          { static_cast<CGFloat>(280 - rCurX),
+                            static_cast<CGFloat>(5*rChoices.getLength()) } };
     [pProto setTitle: @"RadioButtonGroup"];
     [pProto setButtonType: NSRadioButton];
     NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
@@ -1079,43 +1246,56 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     rCurY = aFieldRect.origin.y - 5;
 }
 
-// In 10.5 and later:
-// 'setAccessoryView:' is deprecated
-
-// Make deprecation warnings just warnings in a -Werror compilation.
-
-#ifdef __GNUC__
-// #pragma GCC diagnostic push
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
-#endif
-
 @implementation AquaPrintAccessoryView
-+(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController  withState: (PrintAccessoryViewState*)pState
+
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp
+               withController: (vcl::PrinterController*)pController
+                    withState: (PrintAccessoryViewState*)pState
 {
     const Sequence< PropertyValue >& rOptions( pController->getUIOptions() );
     if( rOptions.getLength() == 0 )
         return nil;
 
+    NSRect aViewFrame = { NSZeroPoint, { 600, 400 } };
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+    NSRect aTabViewFrame = { { 190, 0 }, { 410, 400 } };
+#else
+    NSRect aTabViewFrame = aViewFrame;
+#endif
+
+    NSView* pAccessoryView = [[NSView alloc] initWithFrame: aViewFrame];
+    NSTabView* pTabView = [[NSTabView alloc] initWithFrame: aTabViewFrame];
+    [pAccessoryView addSubview: [pTabView autorelease]];
+
+#ifdef MODERN_IMPLEMENTATION_OF_PRINT_DIALOG
+    // create the accessory controller
+    AquaPrintPanelAccessoryController* pAccessoryController =
+            [[AquaPrintPanelAccessoryController alloc] initWithNibName: nil bundle: nil];
+    [pAccessoryController setView: [pAccessoryView autorelease]];
+    [pAccessoryController forPrintOperation: pOp];
+    [pAccessoryController withPrinterController: pController];
+    [pAccessoryController withViewState: pState];
+#endif
+
     NSView* pCurParent = 0;
     long nCurY = 0;
     long nCurX = 0;
-    NSRect aViewFrame = { NSZeroPoint, {600, 400 } };
-    NSRect aTabViewFrame = { { 190, 0 }, {410, 400 } };
     NSSize aMaxTabSize = NSZeroSize;
-    NSView* pAccessoryView = [[NSView alloc] initWithFrame: aViewFrame];
-    NSTabView* pTabView = [[NSTabView alloc] initWithFrame: aTabViewFrame];
-    [pAccessoryView addSubview: [pTabView autorelease]];
-    
-    bool bIgnoreSubgroup = false;
-    
-    ControllerProperties* pControllerProperties = new ControllerProperties( pController, pOp, pAccessoryView, pTabView, pState );
+
+    ControllerProperties* pControllerProperties =
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+            new ControllerProperties( pController, pOp, pState, pAccessoryView, pTabView );
+#else
+            new ControllerProperties( pAccessoryController );
+#endif
     ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
-    
+
     std::vector< ColumnItem > aLeftColumn, aRightColumn;
-    
+
     // ugly:
     // prepend a "selection" checkbox if the properties have such a selection in PrintContent
     bool bAddSelectionCheckBox = false, bSelectionBoxEnabled = false, bSelectionBoxChecked = false;
+
     for( int i = 0; i < rOptions.getLength(); i++ )
     {
         Sequence< beans::PropertyValue > aOptProp;
@@ -1167,15 +1347,15 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
         rOptions[i].Value >>= aOptProp;
 
         // extract ui element
-        bool bEnabled = true;
         rtl::OUString aCtrlType;
         rtl::OUString aText;
         rtl::OUString aPropertyName;
         rtl::OUString aGroupHint;
         Sequence< rtl::OUString > aChoices;
+        bool bEnabled = true;
         sal_Int64 nMinValue = 0, nMaxValue = 0;
         long nAttachOffset = 0;
-        sal_Bool bIgnore = sal_False;
+        bool bIgnore = false;
 
         for( int n = 0; n < aOptProp.getLength(); n++ )
         {
@@ -1203,7 +1383,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
             {
                 sal_Bool bValue = sal_True;
                 rEntry.Value >>= bValue;
-                bEnabled = bValue;
+                bEnabled = bValue ? true : false;
             }
             else if( rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MinValue")) )
             {
@@ -1219,7 +1399,9 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
             }
             else if( rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("InternalUIOnly")) )
             {
-                rEntry.Value >>= bIgnore;
+                sal_Bool bValue = sal_False;
+                rEntry.Value >>= bValue;
+                bIgnore = bValue ? true : false;
             }
             else if( rEntry.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("GroupingHint")) )
             {
@@ -1235,8 +1417,10 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
             aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Range"))  ||
             aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Bool")) )
         {
-            // since our build target is MacOSX 10.4 we can have only one accessory view
-            // so we have a single accessory view that is tabbed for grouping
+            bool bIgnoreSubgroup = false;
+
+            // with `setAccessoryView' method only one accessory view can be set
+            // so create this single accessory view as tabbed for grouping
             if( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Group"))
                 || ! pCurParent
                 || ( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Subgroup")) && nCurY < -250 && ! bIgnore ) 
@@ -1245,10 +1429,11 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
                 rtl::OUString aGroupTitle( aText );
                 if( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Subgroup")) )
                     aGroupTitle = pControllerProperties->getMoreString();
+
                 // set size of current parent
                 if( pCurParent )
                     adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
-                
+
                 // new tab item
                 if( ! aText.getLength() )
                     aText = "OOo";
@@ -1259,11 +1444,9 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
                 pCurParent = [[NSView alloc] initWithFrame: aTabViewFrame];
                 [pItem setView: pCurParent];
                 [pLabel release];
-                
-                // reset indent
-                nCurX = 20;
-                // reset Y
-                nCurY = 0;
+
+                nCurX = 20; // reset indent
+                nCurY = 0;  // reset Y
                 // clear columns
                 aLeftColumn.clear();
                 aRightColumn.clear();
@@ -1277,7 +1460,7 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
                     bAddSelectionCheckBox = false;
                 }
             }
-            
+
             if( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Subgroup")) && pCurParent )
             {
                 bIgnoreSubgroup = bIgnore;
@@ -1292,12 +1475,12 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
             }
             else if( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Bool")) && pCurParent )
             {
-                sal_Bool bVal = sal_False;                
+                sal_Bool bVal = sal_False;
                 PropertyValue* pVal = pController->getValue( aPropertyName );
                 if( pVal )
                     pVal->Value >>= bVal;
                 addBool( pCurParent, nCurX, nCurY, nAttachOffset,
-                         aText, true, aPropertyName, bVal,
+                         aText, true, aPropertyName, bVal?true:false,
                          aRightColumn, pControllerProperties, pCtrlTarget );
             }
             else if( aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Radio")) && pCurParent )
@@ -1325,7 +1508,8 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
                          aLeftColumn, aRightColumn,
                          pControllerProperties, pCtrlTarget );
             }
-            else if( (aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Edit")) || aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Range"))) && pCurParent )
+            else if( (aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Edit"))
+                || aCtrlType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Range"))) && pCurParent )
             {
                 // current value
                 PropertyValue* pVal = pController->getValue( aPropertyName );
@@ -1341,17 +1525,19 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
             SAL_INFO( "vcl.osx.print", "Unsupported UI option \"" << aCtrlType << "\"");
         }
     }
-        
+
     pControllerProperties->updateEnableState();
     adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
-    
-    // leave some space for the preview
+
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
+    // leave some space for preview
     if( aMaxTabSize.height < 200 )
         aMaxTabSize.height = 200;
-    
+#endif
+
     // now reposition everything again so it is upper bound
     adjustTabViews( pTabView, aMaxTabSize );
-    
+
     // find the minimum needed tab size
     NSSize aTabCtrlSize = [pTabView minimumSize];
     aTabCtrlSize.height += aMaxTabSize.height + 10;
@@ -1361,21 +1547,29 @@ static void addEdit( NSView* pCurParent, long& rCurX, long& rCurY, long nAttachO
     aViewFrame.size.width = aTabCtrlSize.width + aTabViewFrame.origin.x;
     aViewFrame.size.height = aTabCtrlSize.height + aTabViewFrame.origin.y;
     [pAccessoryView setFrameSize: aViewFrame.size];
-    
+
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
     pControllerProperties->setupPreview( pCtrlTarget );
+#endif
 
+#ifdef VINTAGE_IMPLEMENTATION_OF_PRINT_DIALOG
     // set the accessory view
     [pOp setAccessoryView: [pAccessoryView autorelease]];
+#else // -(void)setAccessoryView:(NSView *)aView of NSPrintOperation is deprecated since 10.5
+    // get the print panel
+    NSPrintPanel* pPrintPanel = [pOp printPanel];
+    [pPrintPanel setOptions: [pPrintPanel options] | NSPrintPanelShowsPreview];
+    // add the accessory controller to the panel
+    [pPrintPanel addAccessoryController: [pAccessoryController autorelease]];
+#endif
 
     // set the current selecte tab item
     if( pState->nLastPage >= 0 && pState->nLastPage < [pTabView numberOfTabViewItems] )
         [pTabView selectTabViewItemAtIndex: pState->nLastPage];
-        
+
     return pCtrlTarget;
 }
 
-// #pragma GCC diagnostic pop
-
 @end
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/printview.mm b/vcl/osx/printview.mm
index 8b324b9..3fef61d 100644
--- a/vcl/osx/printview.mm
+++ b/vcl/osx/printview.mm
@@ -24,7 +24,9 @@
 #include "osx/salprn.h"
 
 @implementation AquaPrintView
--(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter
+
+-(id)initWithController: (vcl::PrinterController*)pController
+        withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter
 {
     NSRect aRect = { NSZeroPoint, [pInfoPrinter->getPrintInfo() paperSize] };
     if( (self = [super initWithFrame: aRect]) != nil )
@@ -49,7 +51,9 @@
     // #i101108# sanity check
     if( nWidth < 1 )
         nWidth = 1;
-    NSRect aRect = { { static_cast<CGFloat>(page % nWidth), static_cast<CGFloat>(page / nWidth) }, aPaperSize };
+    NSRect aRect = { { static_cast<CGFloat>(page % nWidth),
+                       static_cast<CGFloat>(page / nWidth) },
+                     aPaperSize };
     return aRect;
 }
 
@@ -61,7 +65,8 @@
 
 -(void)drawRect: (NSRect)rect
 {
-    mpInfoPrinter->setStartPageOffset( static_cast<int>(rect.origin.x), static_cast<int>(rect.origin.y) );
+    mpInfoPrinter->setStartPageOffset( static_cast<int>(rect.origin.x),
+                                       static_cast<int>(rect.origin.y) );
     NSSize aPaperSize =  [mpInfoPrinter->getPrintInfo() paperSize];
     int nPage = (int)(aPaperSize.width * rect.origin.y + rect.origin.x);
     
@@ -69,6 +74,7 @@
     if( nPage - 1 < (mpInfoPrinter->getCurPageRangeStart() + mpInfoPrinter->getCurPageRangeCount() ) )
         mpController->printFilteredPage( nPage-1 );
 }
+
 @end
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 8ef58ad..f28d10e 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -503,8 +503,9 @@ bool AquaSalInfoPrinter::StartJob( const OUString* i_pFileName,
                 bSuccess = true;
                 mbJob = true;
                 pInst->startedPrintJob();
-                [pPrintOperation runOperation];
+                BOOL wasSuccessful = [pPrintOperation runOperation];
                 pInst->endedPrintJob();
+                bSuccess = wasSuccessful ? true : false;
                 bWasAborted = [[[pPrintOperation printInfo] jobDisposition] compare: NSPrintCancelJob] == NSOrderedSame;
                 mbJob = false;
                 if( pReleaseAfterUse )
commit 2ead96e260493b9a8a34a91efe94f89c9f1e5667
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Fri Oct 16 16:12:46 2015 -0400

    temporarily(?) disable ww8export & ww8import qa-tests for Mac OS X 10.5
    
    Change-Id: If4ac2239c3f6ed9d992072a537e3728e1fdbee4e

diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 7dfd541..03fa9a9 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -62,8 +62,8 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
     CppunitTest_sw_ooxmlfieldexport \
     CppunitTest_sw_ooxmlw14export \
     CppunitTest_sw_ooxmlimport \
-    CppunitTest_sw_ww8export \
-    CppunitTest_sw_ww8import \
+    $(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),CppunitTest_sw_ww8export) \
+    $(if $(filter-out 1050,$(MACOSX_SDK_VERSION)),CppunitTest_sw_ww8import) \
     CppunitTest_sw_rtfexport \
     CppunitTest_sw_rtfimport \
     CppunitTest_sw_odfexport \
commit b850c7bfe89327f9f44810374b9124d1bb7bdbb0
Author: Douglas Mencken <dougmencken at gmail.com>
Date:   Thu Oct 15 11:00:00 2015 -0400

    [UNO~C++] [WiP] try to fix UNO bridge for gcc3_macosx_powerpc part

diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx
index 81bae49f..556e87c 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx
@@ -49,7 +49,7 @@ static typelib_TypeClass cpp2uno_call(
 
         // gpreg:  [ret *], this, [gpr params]
         // fpreg:  [fpr params]
-        // ovrflw: [gpr or fpr params (properly aligned)]
+        // ovrflw: [gpr or fpr params (space for entire parameter list aligned)]
 
     // return
     typelib_TypeDescription * pReturnTypeDescr = 0;
@@ -83,11 +83,14 @@ static typelib_TypeClass cpp2uno_call(
 
     // stack space
     assert( sizeof(void *) == sizeof(sal_Int32) && "### unexpected size!" );
+
     // parameters
     void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
     void ** pCppArgs = pUnoArgs + nParams;
+
     // indices of values this have to be converted (interface conversion cpp<=>uno)
     sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+
     // type descriptions for reconversions
     typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
 
@@ -102,7 +105,6 @@ static typelib_TypeClass cpp2uno_call(
         if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
                 // value
         {
-
             switch (pParamTypeDescr->eTypeClass)
             {
 
@@ -524,8 +526,8 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg
 
 int const codeSnippetSize = 136;
 
-unsigned char *  codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset,
-                              bool simpleRetType)
+unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex,
+                  sal_Int32 vtableOffset, bool simpleRetType )
 {
 
   // fprintf(stderr,"in codeSnippet functionIndex is %x\n", functionIndex);
@@ -679,8 +681,9 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
     typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
     sal_Int32 functionCount, sal_Int32 vtableOffset)
 {
-     (*slots) -= functionCount;
-     Slot * s = *slots;
+    (*slots) -= functionCount;
+    Slot * s = *slots;
+
   // fprintf(stderr, "in addLocalFunctions functionOffset is %x\n",functionOffset);
   // fprintf(stderr, "in addLocalFunctions vtableOffset is %x\n",vtableOffset);
   // fflush(stderr);
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx.previous b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx.previous
index 7fb88fe..b2d22f0 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx.previous
+++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx.previous
@@ -46,7 +46,7 @@ static typelib_TypeClass cpp2uno_call(
 
         // gpreg:  [ret *], this, [gpr params]
         // fpreg:  [fpr params]
-        // ovrflw: [gpr or fpr params (space for entire parameter list in structure format properly aligned)]
+        // ovrflw: [gpr or fpr params (space for entire parameter list aligned)]
 
     // return
     typelib_TypeDescription * pReturnTypeDescr = 0;
@@ -59,11 +59,13 @@ static typelib_TypeClass cpp2uno_call(
     sal_Int32 ngpreg = 0;
     sal_Int32 nfpreg = 0;
 
-
+    // handle optional return pointer
     if (pReturnTypeDescr)
     {
         if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr ))
+        {
             pUnoReturn = pRegisterReturn; // direct way for simple types
+        }
         else // complex return via ptr (pCppReturn)
         {
             pCppReturn = *gpreg;
@@ -141,19 +143,19 @@ static typelib_TypeClass cpp2uno_call(
     pCppStack = (char *)ovrflw;
 
     // stack space
-    OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+    assert( sizeof(void *) == sizeof(sal_Int32) && "### unexpected size!" );
 
     // parameters
     void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
     void ** pCppArgs = pUnoArgs + nParams;
 
-    // indizes of values this have to be converted (interface conversion cpp<=>uno)
-    sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+    // indices of values this have to be converted (interface conversion cpp<=>uno)
+    sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams));
 
     // type descriptions for reconversions
     typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
 
-    sal_Int32 nTempIndizes   = 0;
+    sal_Int32 nTempIndices   = 0;
 
     for ( nPos = 0; nPos < nParams; ++nPos )
     {
@@ -199,9 +201,9 @@ static typelib_TypeClass cpp2uno_call(
             {
                 // uno out is unconstructed mem!
                 pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize );
-                pTempIndizes[nTempIndizes] = nPos;
+                pTempIndices[nTempIndices] = nPos;
                 // will be released at reconversion
-                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
             }
             // is in/inout
             else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr ))
@@ -209,9 +211,9 @@ static typelib_TypeClass cpp2uno_call(
                 uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ),
                                         *(void **)pCppStack, pParamTypeDescr,
                                         pThis->getBridge()->getCpp2Uno() );
-                pTempIndizes[nTempIndizes] = nPos; // has to be reconverted
+                pTempIndices[nTempIndices] = nPos; // has to be reconverted
                 // will be released at reconversion
-                ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr;
+                ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr;
             }
             else // direct way
             {
@@ -223,26 +225,24 @@ static typelib_TypeClass cpp2uno_call(
         pCppStack += sizeof(sal_Int32); // standard parameter length
     }
 
-
     // ExceptionHolder
     uno_Any aUnoExc; // Any will be constructed by callee
     uno_Any * pUnoExc = &aUnoExc;
 
     // invoke uno dispatch call
-    (*pThis->getUnoI()->pDispatcher)(
-         pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
+    (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc );
 
     // in case an exception occurred...
     if (pUnoExc)
     {
         // destruct temporary in/inout params
-        for ( ; nTempIndizes--; )
+        for ( ; nTempIndices--; )
         {
-            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
+            sal_Int32 nIndex = pTempIndices[nTempIndices];
 
             if (pParams[nIndex].bIn) // is in/inout => was constructed
-                uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 );
-            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] );
+                uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], 0 );
+            TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
         }
         if (pReturnTypeDescr)
             TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
@@ -256,10 +256,10 @@ static typelib_TypeClass cpp2uno_call(
     else // else no exception occurred...
     {
         // temporary params
-        for ( ; nTempIndizes--; )
+        for ( ; nTempIndices--; )
         {
-            sal_Int32 nIndex = pTempIndizes[nTempIndizes];
-            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes];
+            sal_Int32 nIndex = pTempIndices[nTempIndices];
+            typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices];
 
             if (pParams[nIndex].bOut) // inout/out
             {
@@ -305,7 +305,7 @@ static typelib_TypeClass cpp_mediate(
         void ** gpreg, void ** fpreg, void ** ovrflw,
     sal_Int64 * pRegisterReturn /* space for register return */ )
 {
-    OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" );
+    assert( sizeof(sal_Int32)==sizeof(void *) && "### unexpected!" );
 
     // gpreg:  [ret *], this, [other gpr params]
     // fpreg:  [fpr params]
@@ -329,7 +329,7 @@ static typelib_TypeClass cpp_mediate(
 
     typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr();
 
-    OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" );
+    assert( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex && "### illegal vtable index!" );
     if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex)
     {
         throw RuntimeException(
@@ -339,7 +339,7 @@ static typelib_TypeClass cpp_mediate(
 
     // determine called method
     sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex];
-    OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" );
+    assert( nMemberPos < pTypeDescr->nAllMembers && "### illegal member index!" );
 
     TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] );
 
@@ -516,7 +516,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex,
     if (! simpleRetType )
         functionIndex |= 0x80000000;
 
-    // OSL_ASSERT( sizeof (long) == 4 );
+    // assert( sizeof (long) == 4 );
 
     // FIXME: why are we leaving an 8k gap in the stack here
     // FIXME: is this to allow room for signal handling frames?
@@ -652,7 +652,8 @@ sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
 
 bridges::cpp_uno::shared::VtableFactory::Slot *
 bridges::cpp_uno::shared::VtableFactory::initializeBlock(
-    void * block, sal_Int32 slotCount)
+    void * block, sal_Int32 slotCount, sal_Int32,
+    typelib_InterfaceTypeDescription *)
 {
     Slot * slots = mapBlockToVtable(block);
     slots[-2].fn = 0;
@@ -675,7 +676,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
     for (sal_Int32 i = 0; i < type->nMembers; ++i) {
         typelib_TypeDescription * member = 0;
         TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
-        OSL_ASSERT(member != 0);
+        assert(member != 0);
         switch (member->eTypeClass) {
         case typelib_TypeClass_INTERFACE_ATTRIBUTE:
             // Getter:
@@ -708,7 +709,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
             break;
 
         default:
-            OSL_ASSERT(false);
+            assert(false);
             break;
         }
         TYPELIB_DANGER_RELEASE(member);
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx
index 9c09999..b0a4e3f 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx
@@ -303,7 +303,7 @@ static void callVirtualMethod(
 
 static void cpp_call(
     bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
-    bridges::cpp_uno::shared::VtableSlot  aVtableSlot,
+    bridges::cpp_uno::shared::VtableSlot aVtableSlot,
     typelib_TypeDescriptionReference * pReturnTypeRef,
     sal_Int32 nParams, typelib_MethodParameter * pParams,
     void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc )
@@ -320,7 +320,7 @@ static void cpp_call(
     // return
     typelib_TypeDescription * pReturnTypeDescr = 0;
     TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
-    // assert( pReturnTypeDescr && "### expected return type description!" );
+    //assert( pReturnTypeDescr && "### expected return type description!" );
 
     void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
 
@@ -341,13 +341,13 @@ static void cpp_call(
         }
     }
     // push this
-        void* pAdjustedThisPtr = reinterpret_cast< void **>(pThis->getCppI()) + aVtableSlot.offset;
+    void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI()) + aVtableSlot.offset;
     *(void**)pCppStack = pAdjustedThisPtr;
     pCppStack += sizeof( void* );
         *pPT++ = 'I';
 
     // stack space
-    // assert( sizeof(void *) == sizeof(sal_Int32) && "### unexpected size!" );
+    //assert( sizeof(void *) == sizeof(sal_Int32) && "### unexpected size!" );
     // args
     void ** pCppArgs  = (void **)alloca( 3 * sizeof(void *) * nParams );
     // indices of values this have to be converted (interface conversion cpp<=>uno)
@@ -430,8 +430,7 @@ static void cpp_call(
             {
                 uno_copyAndConvertData(
                     *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
-                    pUnoArgs[nPos], pParamTypeDescr,
-                                        pThis->getBridge()->getUno2Cpp() );
+                    pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
 
                 pTempIndices[nTempIndices] = nPos; // has to be reconverted
                 // will be released at reconversion
@@ -499,8 +498,7 @@ static void cpp_call(
      catch (...)
      {
           // fill uno exception
-        fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions,
-                                  *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
+        fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() );
 
         // temporary params
         for ( ; nTempIndices--; )
@@ -525,8 +523,8 @@ void unoInterfaceProxyDispatch(
     void * pReturn, void * pArgs[], uno_Any ** ppException )
 {
     // is my surrogate
-        bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
-            = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI);
+    bridges::cpp_uno::shared::UnoInterfaceProxy * pThis
+            = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * > (pUnoI);
 
     switch (pMemberDescr->eTypeClass)
     {
diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx.previous b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx.previous
index 0f5e0bc..67435c0 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx.previous
+++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx.previous
@@ -38,7 +38,7 @@ using namespace ::com::sun::star::uno;
 namespace
 {
 
-//==================================================================================================
+
 static void callVirtualMethod(
     void * pAdjustedThisPtr,
     sal_Int32 nVtableIndex,
@@ -77,9 +77,6 @@ static void callVirtualMethod(
      // Note: This keeps us from having to decode the signature twice and
      // prevents problems with later local variables.
 
-     // FIXME: I do not believe the following is true but we will keep the
-     // FIXME: extra space just to be safe until proven otherwise
-
      // Note: could require up to  2*nStackLongs words of parameter stack area
      // if the call has many float parameters (i.e. floats take up only 1
      // word on the stack but take 2 words in parameter area in the
@@ -267,16 +264,16 @@ static void callVirtualMethod(
         case typelib_TypeClass_CHAR:
         case typelib_TypeClass_SHORT:
         case typelib_TypeClass_UNSIGNED_SHORT:
-                *(unsigned short*)pRegisterReturn = (unsigned short)iret;
+            *(unsigned short*)pRegisterReturn = (unsigned short)iret;
             break;
 
         case typelib_TypeClass_BOOLEAN:
         case typelib_TypeClass_BYTE:
-                *(unsigned char*)pRegisterReturn = (unsigned char)iret;
+            *(unsigned char*)pRegisterReturn = (unsigned char)iret;
             break;
 
         case typelib_TypeClass_FLOAT:
-                *(float*)pRegisterReturn = (float)dret;
+            *(float*)pRegisterReturn = (float)dret;
             break;
 
         case typelib_TypeClass_DOUBLE:
@@ -288,7 +285,6 @@ static void callVirtualMethod(
 }
 
 
-//==================================================================================================
 static void cpp_call(
     bridges::cpp_uno::shared::UnoInterfaceProxy * pThis,
     bridges::cpp_uno::shared::VtableSlot aVtableSlot,
@@ -308,7 +304,7 @@ static void cpp_call(
     // return
     typelib_TypeDescription * pReturnTypeDescr = 0;
     TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
-    OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" );
+    //assert( pReturnTypeDescr && "### expected return type description!" );
 
     void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
 
@@ -330,22 +326,21 @@ static void cpp_call(
         }
     }
     // push this
-        void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI())
-      + aVtableSlot.offset;
+    void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI()) + aVtableSlot.offset;
     *(void**)pCppStack = pAdjustedThisPtr;
     pCppStack += sizeof( void* );
         *pPT++ = 'I';
 
     // stack space
-    OSL_ENSURE( sizeof(void *) == sizeof(sal_Int32), "### unexpected size!" );
+    //assert( sizeof(void *) == sizeof(sal_Int32) && "### unexpected size!" );
     // args
     void ** pCppArgs  = (void **)alloca( 3 * sizeof(void *) * nParams );
-    // indizes of values this have to be converted (interface conversion cpp<=>uno)
-    sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams);
+    // indices of values this have to be converted (interface conversion cpp<=>uno)
+    sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams);
     // type descriptions for reconversions
     typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams));
 
-    sal_Int32 nTempIndizes   = 0;
+    sal_Int32 nTempIndices   = 0;
 
     for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
     {
@@ -353,8 +348,7 @@ static void cpp_call(
         typelib_TypeDescription * pParamTypeDescr = 0;
         TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
 
-        if (!rParam.bOut
-                    && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
+        if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
         {
             uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr,
                                     pThis->getBridge()->getUno2Cpp() );
@@ -412,9 +406,9 @@ static void cpp_call(
                 uno_constructData(
                     *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ),
                     pParamTypeDescr );
-                pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call
+                pTempIndices[nTempIndices] = nPos; // default constructed for cpp call
                 // will be released at reconversion

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list