accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx | 4 cui/source/inc/cuitabline.hxx | 2 framework/source/services/autorecovery.cxx | 165 +++++----- framework/source/services/modulemanager.cxx | 13 sw/source/core/doc/doccomp.cxx | 1 vcl/generic/fontmanager/fontconfig.cxx | 21 + 6 files changed, 125 insertions(+), 81 deletions(-)
New commits: commit 65a3ec97b5032d1748c8f84eeb0b8656e1c25918 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Feb 20 12:06:52 2012 +0000 Resoves fdo#42901 duplicated .pfb without duplicated .afm drops font If we have a duplicate font entry the duplicate is dropped, but if the first font was invalid, e.g. .pfb without .afm this results in dropping *both* fonts, the valid and invalid one diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index 4fd5d9e..db53846 100644 --- a/vcl/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx @@ -466,6 +466,19 @@ namespace } } +//FontConfig doesn't come with a way to remove an element from a FontSet as far +//as I can see +static void lcl_FcFontSetRemove(FcFontSet* pFSet, int i) +{ + FcPatternDestroy(pFSet->fonts[i]); + + int nTail = pFSet->nfont - (i + 1); + --pFSet->nfont; + if (!nTail) + return; + memmove(pFSet->fonts + i, pFSet->fonts + i + 1, nTail*sizeof(FcPattern*)); +} + int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, int, rtl::OStringHash>& o_rVisitedPaths ) { int nFonts = 0; @@ -557,7 +570,13 @@ int PrintFontManager::countFontconfigFonts( boost::unordered_map<rtl::OString, i } if( aFonts.empty() ) { - // TODO: remove fonts unusable to psprint from fontset + //remove font, reuse index + //we want to remove unusable fonts here, in case there is a usable font + //which duplicates the properties of the unusable one + // + //not removing the unusable font will risk the usable font being rejected + //as a duplicate by isPreviouslyDuplicateOrObsoleted + lcl_FcFontSetRemove(pFSet, i--); continue; } commit 1be196c7fbf59fd811f19505f4691b979b6d4bdb Author: Caolán McNamara <caol...@redhat.com> Date: Sun Feb 19 19:51:40 2012 +0000 WaE: unused variables diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 6bbfc29..3436710 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -692,7 +692,9 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams) throw; } catch(const css::uno::Exception&) - {} // TODO better error handling + { + // TODO better error handling + } aListenerInformer.stop(); @@ -972,12 +974,12 @@ css::uno::Reference< css::container::XNameAccess > AutoRecovery::implts_openConf ::comphelper::ConfigurationHelper::E_STANDARD) >>= nMinSpaceConfigSave; } catch(const css::uno::Exception&) - { - // These config keys are not sooooo important, that - // we are interested on errors here realy .-) - nMinSpaceDocSave = MIN_DISCSPACE_DOCSAVE; - nMinSpaceConfigSave = MIN_DISCSPACE_CONFIGSAVE; - } + { + // These config keys are not sooooo important, that + // we are interested on errors here realy .-) + nMinSpaceDocSave = MIN_DISCSPACE_DOCSAVE; + nMinSpaceConfigSave = MIN_DISCSPACE_CONFIGSAVE; + } // SAFE -> ---------------------------------- aWriteLock.lock(); @@ -1291,7 +1293,9 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn xModify->removeByName(sID); } catch(const css::container::NoSuchElementException&) - { return; } + { + return; + } } else { @@ -1317,9 +1321,13 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn } } catch(const css::uno::RuntimeException&) - { throw; } + { + throw; + } catch(const css::uno::Exception&) - {} // ??? can it happen that a full disc let these set of operations fail too ??? + { + // ??? can it happen that a full disc let these set of operations fail too ??? + } sal_Int32 nRetry = RETRY_STORE_ON_FULL_DISC_FOREVER; do @@ -1336,28 +1344,28 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn nRetry = 0; } catch(const css::uno::Exception&) - { - // a) FULL DISC seams to be the problem behind => show error and retry it forever (e.g. retry=300) - // b) unknown problem (may be locking problem) => reset RETRY value to more usefull value(!) (e.g. retry=3) - // c) unknown problem (may be locking problem) + 1..2 repeating operations => throw the original exception to force generation of a stacktrace ! - - // SAFE -> - ReadGuard aReadLock(m_aLock); - sal_Int32 nMinSpaceConfigSave = m_nMinSpaceConfigSave; - aReadLock.unlock(); - // <- SAFE - - if (! impl_enoughDiscSpace(nMinSpaceConfigSave)) - AutoRecovery::impl_showFullDiscError(); - else - if (nRetry > RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL) - nRetry = RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL; - else - if (nRetry <= GIVE_UP_RETRY) - throw; // force stacktrace to know if there exist might other reasons, why an AutoSave can fail !!! + { + // a) FULL DISC seams to be the problem behind => show error and retry it forever (e.g. retry=300) + // b) unknown problem (may be locking problem) => reset RETRY value to more usefull value(!) (e.g. retry=3) + // c) unknown problem (may be locking problem) + 1..2 repeating operations => throw the original exception to force generation of a stacktrace ! + + // SAFE -> + ReadGuard aReadLock(m_aLock); + sal_Int32 nMinSpaceConfigSave = m_nMinSpaceConfigSave; + aReadLock.unlock(); + // <- SAFE + + if (! impl_enoughDiscSpace(nMinSpaceConfigSave)) + AutoRecovery::impl_showFullDiscError(); + else + if (nRetry > RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL) + nRetry = RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL; + else + if (nRetry <= GIVE_UP_RETRY) + throw; // force stacktrace to know if there exist might other reasons, why an AutoSave can fail !!! - --nRetry; - } + --nRetry; + } } while(nRetry>0); } @@ -2030,7 +2038,8 @@ void lc_removeLockFile(AutoRecovery::TDocumentInfo& rInfo) } } catch( const css::uno::Exception& ) - {} + { + } } } @@ -2085,17 +2094,11 @@ void AutoRecovery::implts_prepareSessionShutdown() { xClose->close(sal_False); } - /* - catch(const css::lang::DisposedException&) - { - // closed ... disposed ... always the same .-) - } - */ catch(const css::uno::Exception&) - { - // At least it's only a try to close these documents before anybody else it does. - // So it seams to be possible to ignore any error here .-) - } + { + // At least it's only a try to close these documents before anybody else it does. + // So it seams to be possible to ignore any error here .-) + } rInfo.Document.clear(); } @@ -2374,30 +2377,30 @@ void AutoRecovery::implts_saveOneDoc(const ::rtl::OUString& nRetry = 0; } catch(const css::uno::Exception&) - { - bError = sal_True; + { + bError = sal_True; - // a) FULL DISC seams to be the problem behind => show error and retry it forever (e.g. retry=300) - // b) unknown problem (may be locking problem) => reset RETRY value to more usefull value(!) (e.g. retry=3) - // c) unknown problem (may be locking problem) + 1..2 repeating operations => throw the original exception to force generation of a stacktrace ! + // a) FULL DISC seams to be the problem behind => show error and retry it forever (e.g. retry=300) + // b) unknown problem (may be locking problem) => reset RETRY value to more usefull value(!) (e.g. retry=3) + // c) unknown problem (may be locking problem) + 1..2 repeating operations => throw the original exception to force generation of a stacktrace ! - // SAFE -> - ReadGuard aReadLock2(m_aLock); - sal_Int32 nMinSpaceDocSave = m_nMinSpaceDocSave; - aReadLock2.unlock(); - // <- SAFE + // SAFE -> + ReadGuard aReadLock2(m_aLock); + sal_Int32 nMinSpaceDocSave = m_nMinSpaceDocSave; + aReadLock2.unlock(); + // <- SAFE - if (! impl_enoughDiscSpace(nMinSpaceDocSave)) - AutoRecovery::impl_showFullDiscError(); - else - if (nRetry > RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL) - nRetry = RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL; - else - if (nRetry <= GIVE_UP_RETRY) - throw; // force stacktrace to know if there exist might other reasons, why an AutoSave can fail !!! + if (! impl_enoughDiscSpace(nMinSpaceDocSave)) + AutoRecovery::impl_showFullDiscError(); + else + if (nRetry > RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL) + nRetry = RETRY_STORE_ON_MIGHT_FULL_DISC_USEFULL; + else + if (nRetry <= GIVE_UP_RETRY) + throw; // force stacktrace to know if there exist might other reasons, why an AutoSave can fail !!! - --nRetry; - } + --nRetry; + } } while(nRetry>0); @@ -2726,7 +2729,9 @@ void AutoRecovery::implts_openOneDoc(const ::rtl::OUString& sURL rInfo.Document = xModel.get(); } catch(const css::uno::RuntimeException&) - { throw; } + { + throw; + } catch(const css::uno::Exception&) { Any aCaughtException( ::cppu::getCaughtException() ); @@ -2822,7 +2827,9 @@ void AutoRecovery::implts_informListener( sal_Int32 eJ xListener->statusChanged(aEvent); } catch(const css::uno::RuntimeException&) - { pIt.remove(); } + { + pIt.remove(); + } } } } @@ -3243,7 +3250,9 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const ::rtl::OUSt aTargetContent = ::ucbhelper::Content(sTargetPath, xEnvironment); } catch(const css::uno::Exception&) - { return AutoRecovery::E_WRONG_TARGET_PATH; } + { + return AutoRecovery::E_WRONG_TARGET_PATH; + } sal_Int32 nNameClash; nNameClash = css::ucb::NameClash::RENAME; @@ -3254,7 +3263,9 @@ AutoRecovery::EFailureSafeResult AutoRecovery::implts_copyFile(const ::rtl::OUSt aTargetContent.transferContent(aSourceContent, ::ucbhelper::InsertOperation_COPY, sTargetName, nNameClash); } catch(const css::uno::Exception&) - { return AutoRecovery::E_ORIGINAL_FILE_MISSING; } + { + return AutoRecovery::E_ORIGINAL_FILE_MISSING; + } return AutoRecovery::E_COPIED; } @@ -3409,7 +3420,9 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() // can happen in multithreaded environments, that frames was removed from the container during this loop runs! // Ignore it. catch(const css::lang::IndexOutOfBoundsException&) - { continue; } + { + continue; + } // We are interested on visible documents only. // Note: It's n optional interface .-( @@ -3442,10 +3455,13 @@ void AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList() implts_registerDocument(xModel); } } - catch(const css::uno::RuntimeException& exRun) - { throw; } + catch(const css::uno::RuntimeException&) + { + throw; + } catch(const css::uno::Exception&) - {} + { + } LOG_RECOVERY("... AutoRecovery::implts_verifyCacheAgainstDesktopDocumentList()") } @@ -3620,7 +3636,8 @@ void AutoRecovery::impl_flushALLConfigChanges() ::utl::ConfigManager::storeConfigItems(); } catch(const css::uno::Exception&) - {} + { + } } //----------------------------------------------- @@ -3635,7 +3652,8 @@ void AutoRecovery::st_impl_removeFile(const ::rtl::OUString& sURL) aContent.executeCommand(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), css::uno::makeAny(sal_True)); } catch(const css::uno::Exception&) - {} + { + } } //----------------------------------------------- @@ -3654,7 +3672,8 @@ void AutoRecovery::st_impl_removeLockFile() AutoRecovery::st_impl_removeFile(sLockURL); } catch(const css::uno::Exception&) - {} + { + } } } // namespace framework diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index 9ae3cfd..665d3dc 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -347,7 +347,8 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL ModuleManager::crea lResult.push_back(css::uno::makeAny(lModuleProps.getAsConstPropertyValueList())); } catch(const css::uno::Exception&) - {} + { + } } ::comphelper::OAnyEnumeration* pEnum = new ::comphelper::OAnyEnumeration(lResult.getAsConstList()); @@ -377,10 +378,14 @@ css::uno::Reference< css::container::XNameAccess > ModuleManager::implts_getConf CFGPATH_FACTORIES, ::comphelper::ConfigurationHelper::E_READONLY); } - catch(const css::uno::RuntimeException& exRun) - { throw; } + catch(const css::uno::RuntimeException&) + { + throw; + } catch(const css::uno::Exception&) - { xCfg.clear(); } + { + xCfg.clear(); + } // SAFE -> ---------------------------------- WriteGuard aWriteLock(m_aLock); commit 39d6e42ca461a115e218eca67e4ed4365b3cf511 Author: Caolán McNamara <caol...@redhat.com> Date: Sun Feb 19 19:48:26 2012 +0000 WaE: ununsed variables diff --git a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx index 835bcd3..9ee03eb 100644 --- a/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx +++ b/accessibility/bridge/source/java/WindowsAccessBridgeAdapter.cxx @@ -168,7 +168,7 @@ Java_org_openoffice_accessibility_WindowsAccessBridgeAdapter_createMapping(JNIEn } } - catch ( RuntimeException &e) + catch (const RuntimeException &) { OSL_TRACE("RuntimeException caught while initializing the mapping"); } @@ -252,7 +252,7 @@ void handleWindowEvent(Window * pWindow, bool bShow) } } } - catch (::com::sun::star::uno::RuntimeException &e) + catch (const ::com::sun::star::uno::RuntimeException &) { // Ignore show events that throw DisposedExceptions in getAccessibleContext(), // but keep revoking these windows in hide(s). commit efbbf9b63cc80d1f1a749ccbc2312a1a76b3bac0 Author: Caolán McNamara <caol...@redhat.com> Date: Sun Feb 19 19:46:03 2012 +0000 WaE: msvc:C4099 diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx index 901d934..7d0793a 100644 --- a/cui/source/inc/cuitabline.hxx +++ b/cui/source/inc/cuitabline.hxx @@ -91,7 +91,7 @@ public: /*************************************************************************/ -class SvxBmpItemInfo; +struct SvxBmpItemInfo; typedef ::std::vector< SvxBmpItemInfo* > SvxBmpItemInfoList; class SvxLineTabPage : public SvxTabPage commit ba1eaf504aefefde0db374f20e7f5bb6d28cde5a Author: Caolán McNamara <caol...@redhat.com> Date: Sun Feb 19 19:42:51 2012 +0000 WaE: add virtual dtor diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 1da7704..80c77c4 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -200,6 +200,7 @@ public: virtual bool Compare( int nIdx1, int nIdx2 ) const = 0; virtual int GetLen1() const = 0; virtual int GetLen2() const = 0; + virtual ~ArrayComparator() {} }; // Consider two lines equal if similar enough (e.g. look like different
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits