include/unotools/securityoptions.hxx | 2 sc/source/filter/xml/xmlimprt.cxx | 10 ++ sc/source/ui/docshell/docsh4.cxx | 18 +++- svtools/source/java/javainteractionhandler.cxx | 2 svx/source/sdr/contact/viewobjectcontactofgraphic.cxx | 21 +++- sw/source/core/doc/docnew.cxx | 10 ++ sw/source/core/uibase/app/docsh.cxx | 6 + sw/source/filter/xml/xmlimp.cxx | 78 +++++++++--------- unotools/source/config/securityoptions.cxx | 8 + 9 files changed, 104 insertions(+), 51 deletions(-)
New commits: commit c1c3c282be11bb383bd3d5401bf9397f18add48a Author: Stephan Bergmann <[email protected]> Date: Tue Jun 23 08:26:36 2015 +0200 LinkUpdateMode is a global setting (cherry picked from commit 77cc71476bae2b3655102e2c29d36af40a393201) Conflicts: sw/source/core/doc/DocumentLinksAdministrationManager.cxx sw/source/filter/xml/xmlimp.cxx Change-Id: Ida1257337c6e0916f2228fe053d9c9f085183af6 Reviewed-on: https://gerrit.libreoffice.org/16422 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Miklos Vajna <[email protected]> diff --git a/include/unotools/securityoptions.hxx b/include/unotools/securityoptions.hxx index 3bd8807..77e4720 100644 --- a/include/unotools/securityoptions.hxx +++ b/include/unotools/securityoptions.hxx @@ -186,6 +186,8 @@ class UNOTOOLS_DLLPUBLIC SAL_WARN_UNUSED SvtSecurityOptions : public utl::detail */ bool isTrustedLocationUri(OUString const & uri) const; + bool isTrustedLocationUriForUpdatingLinks(OUString const & uri) const; + ::com::sun::star::uno::Sequence< Certificate > GetTrustedAuthors ( ) const; void SetTrustedAuthors ( const ::com::sun::star::uno::Sequence< Certificate >& rAuthors ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index a3fb7d5..bf1beeb 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2630,6 +2630,9 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa OUString sCTName("TrackedChangesProtectionKey"); OUString sVBName("VBACompatibilityMode"); OUString sSCName("ScriptConfiguration"); + css::uno::Sequence<css::beans::PropertyValue> aFilteredProps( + aConfigProps.getLength()); + sal_Int32 nFilteredPropsLen = 0; for (sal_Int32 i = nCount - 1; i >= 0; --i) { if (aConfigProps[i].Name == sCTName) @@ -2664,11 +2667,16 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa xImportInfo->setPropertyValue( aConfigProps[i].Name, aConfigProps[i].Value ); } } + if (aConfigProps[i].Name != "LinkUpdateMode") + { + aFilteredProps[nFilteredPropsLen++] = aConfigProps[i]; + } } + aFilteredProps.realloc(nFilteredPropsLen); uno::Reference <uno::XInterface> xInterface = xMultiServiceFactory->createInstance("com.sun.star.comp.SpreadsheetSettings"); uno::Reference <beans::XPropertySet> xProperties(xInterface, uno::UNO_QUERY); if (xProperties.is()) - SvXMLUnitConverter::convertPropertySet(xProperties, aConfigProps); + SvXMLUnitConverter::convertPropertySet(xProperties, aFilteredProps); } } } diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 13855e6..3961186 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -48,6 +48,7 @@ using namespace ::com::sun::star; #include <svl/PasswordHelper.hxx> #include <svl/documentlockfile.hxx> #include <svl/sharecontrolfile.hxx> +#include <unotools/securityoptions.hxx> #include <comphelper/processfactory.hxx> #include "docuno.hxx" @@ -423,12 +424,23 @@ void ScDocShell::Execute( SfxRequest& rReq ) if (nCanUpdate == com::sun::star::document::UpdateDocMode::NO_UPDATE) nSet = LM_NEVER; - else if (nCanUpdate == com::sun::star::document::UpdateDocMode::QUIET_UPDATE && - nSet == LM_ON_DEMAND) - nSet = LM_NEVER; else if (nCanUpdate == com::sun::star::document::UpdateDocMode::FULL_UPDATE) nSet = LM_ALWAYS; + if (nSet == LM_ALWAYS + && !(SvtSecurityOptions() + .isTrustedLocationUriForUpdatingLinks( + GetMedium() == nullptr + ? OUString() : GetMedium()->GetName()))) + { + nSet = LM_ON_DEMAND; + } + if (nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE + && nSet == LM_ON_DEMAND) + { + nSet = LM_NEVER; + } + if(nSet==LM_ON_DEMAND) { QueryBox aBox( GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES), diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index d42dd9f..86447aa 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -44,6 +44,7 @@ #include <editeng/forbiddencharacterstable.hxx> #include <svl/zforlist.hxx> #include <unotools/lingucfg.hxx> +#include <unotools/securityoptions.hxx> #include <svx/svdpage.hxx> #include <paratr.hxx> #include <fchrfmt.hxx> @@ -889,6 +890,15 @@ void SwDoc::UpdateLinks( bool bUI ) case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate = false; break; case document::UpdateDocMode::FULL_UPDATE: bAskUpdate = true; break; } + if (nLinkMode == AUTOMATIC && !bAskUpdate) + { + SfxMedium * medium = GetDocShell()->GetMedium(); + if (!SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks( + medium == nullptr ? OUString() : medium->GetName())) + { + bAskUpdate = true; + } + } if( bUpdate && (bUI || !bAskUpdate) ) { SfxMedium* pMedium = GetDocShell()->GetMedium(); diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index b04cfbd..2636c95 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1075,46 +1075,46 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC if( !xInfo.is() ) return; - boost::unordered_set< OUString, OUStringHash > aSet; - aSet.insert("ForbiddenCharacters"); - aSet.insert("IsKernAsianPunctuation"); - aSet.insert("CharacterCompressionType"); - aSet.insert("LinkUpdateMode"); - aSet.insert("FieldAutoUpdate"); - aSet.insert("ChartAutoUpdate"); - aSet.insert("AddParaTableSpacing"); - aSet.insert("AddParaTableSpacingAtStart"); - aSet.insert("PrintAnnotationMode"); - aSet.insert("PrintBlackFonts"); - aSet.insert("PrintControls"); - aSet.insert("PrintDrawings"); - aSet.insert("PrintGraphics"); - aSet.insert("PrintLeftPages"); - aSet.insert("PrintPageBackground"); - aSet.insert("PrintProspect"); - aSet.insert("PrintReversed"); - aSet.insert("PrintRightPages"); - aSet.insert("PrintFaxName"); - aSet.insert("PrintPaperFromSetup"); - aSet.insert("PrintTables"); - aSet.insert("PrintSingleJobs"); - aSet.insert("UpdateFromTemplate"); - aSet.insert("PrinterIndependentLayout"); - aSet.insert("PrintEmptyPages"); - aSet.insert("SmallCapsPercentage66"); - aSet.insert("TabOverflow"); - aSet.insert("UnbreakableNumberings"); - aSet.insert("ClippedPictures"); - aSet.insert("BackgroundParaOverDrawings"); - aSet.insert("TabOverMargin"); - aSet.insert("PropLineSpacingShrinksFirstLine"); + boost::unordered_set< OUString, OUStringHash > aExcludeAlways; + aExcludeAlways.insert("LinkUpdateMode"); + boost::unordered_set< OUString, OUStringHash > aExcludeWhenNotLoadingUserSettings; + aExcludeWhenNotLoadingUserSettings.insert("ForbiddenCharacters"); + aExcludeWhenNotLoadingUserSettings.insert("IsKernAsianPunctuation"); + aExcludeWhenNotLoadingUserSettings.insert("CharacterCompressionType"); + aExcludeWhenNotLoadingUserSettings.insert("FieldAutoUpdate"); + aExcludeWhenNotLoadingUserSettings.insert("ChartAutoUpdate"); + aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacing"); + aExcludeWhenNotLoadingUserSettings.insert("AddParaTableSpacingAtStart"); + aExcludeWhenNotLoadingUserSettings.insert("PrintAnnotationMode"); + aExcludeWhenNotLoadingUserSettings.insert("PrintBlackFonts"); + aExcludeWhenNotLoadingUserSettings.insert("PrintControls"); + aExcludeWhenNotLoadingUserSettings.insert("PrintDrawings"); + aExcludeWhenNotLoadingUserSettings.insert("PrintGraphics"); + aExcludeWhenNotLoadingUserSettings.insert("PrintLeftPages"); + aExcludeWhenNotLoadingUserSettings.insert("PrintPageBackground"); + aExcludeWhenNotLoadingUserSettings.insert("PrintProspect"); + aExcludeWhenNotLoadingUserSettings.insert("PrintReversed"); + aExcludeWhenNotLoadingUserSettings.insert("PrintRightPages"); + aExcludeWhenNotLoadingUserSettings.insert("PrintFaxName"); + aExcludeWhenNotLoadingUserSettings.insert("PrintPaperFromSetup"); + aExcludeWhenNotLoadingUserSettings.insert("PrintTables"); + aExcludeWhenNotLoadingUserSettings.insert("PrintSingleJobs"); + aExcludeWhenNotLoadingUserSettings.insert("UpdateFromTemplate"); + aExcludeWhenNotLoadingUserSettings.insert("PrinterIndependentLayout"); + aExcludeWhenNotLoadingUserSettings.insert("PrintEmptyPages"); + aExcludeWhenNotLoadingUserSettings.insert("SmallCapsPercentage66"); + aExcludeWhenNotLoadingUserSettings.insert("TabOverflow"); + aExcludeWhenNotLoadingUserSettings.insert("UnbreakableNumberings"); + aExcludeWhenNotLoadingUserSettings.insert("ClippedPictures"); + aExcludeWhenNotLoadingUserSettings.insert("BackgroundParaOverDrawings"); + aExcludeWhenNotLoadingUserSettings.insert("TabOverMargin"); + aExcludeWhenNotLoadingUserSettings.insert("PropLineSpacingShrinksFirstLine"); sal_Int32 nCount = aConfigProps.getLength(); const PropertyValue* pValues = aConfigProps.getConstArray(); SvtSaveOptions aSaveOpt; - bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(), - bSet = bIsUserSetting; + bool bIsUserSetting = aSaveOpt.IsLoadUserSettings(); // for some properties we don't want to use the application // default if they're missing. So we watch for them in the loop @@ -1150,10 +1150,12 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC while( nCount-- ) { - if( !bIsUserSetting ) + bool bSet = aExcludeAlways.find(pValues->Name) == aExcludeAlways.end(); + if( bSet && !bIsUserSetting + && (aExcludeWhenNotLoadingUserSettings.find(pValues->Name) + != aExcludeWhenNotLoadingUserSettings.end()) ) { - // test over the hash value if the entry is in the table. - bSet = aSet.find(pValues->Name) == aSet.end(); + bSet = false; } if( bSet ) diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx index 7906ed7..86055c5 100644 --- a/unotools/source/config/securityoptions.cxx +++ b/unotools/source/config/securityoptions.cxx @@ -1051,6 +1051,14 @@ bool SvtSecurityOptions::isTrustedLocationUri(OUString const & uri) const { return false; } +bool SvtSecurityOptions::isTrustedLocationUriForUpdatingLinks( + OUString const & uri) const +{ + return GetMacroSecurityLevel() == 0 || uri.isEmpty() + || uri.startsWithIgnoreAsciiCase("private:") + || isTrustedLocationUri(uri); +} + sal_Int32 SvtSecurityOptions::GetMacroSecurityLevel() const { MutexGuard aGuard( GetInitMutex() ); commit e984d67e29e5d12cad92db4f91cd0cf9a277fab9 Author: Andras Timar <[email protected]> Date: Thu Jul 2 18:36:08 2015 +0200 users are annoyed by "JRE Required" dialog Change-Id: I193128e3abd5bcd396c9cac7ace954e37251f644 diff --git a/svtools/source/java/javainteractionhandler.cxx b/svtools/source/java/javainteractionhandler.cxx index 6d2e549..f027311 100644 --- a/svtools/source/java/javainteractionhandler.cxx +++ b/svtools/source/java/javainteractionhandler.cxx @@ -50,7 +50,7 @@ JavaInteractionHandler::JavaInteractionHandler(bool bReportErrorOnce) : m_bShowErrorsOnce(bReportErrorOnce), m_bJavaDisabled_Handled(false), m_bInvalidSettings_Handled(false), - m_bJavaNotFound_Handled(false), + m_bJavaNotFound_Handled(true), // users are annoyed by "JRE Required" dialog m_bVMCreationFailure_Handled(false), m_bRestartRequired_Handled(false), m_nResult_JavaDisabled(RET_NO) commit 239d73f6955b4a4530e4dde8372968cc8df25ad9 Author: Julien Nabet <[email protected]> Date: Sun Jun 28 12:43:19 2015 +0200 tdf#92386: Writer crashes in print preview if document in 2 windows 2 changes for the 2 following bts First bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116883 Second bt: see https://bugs.documentfoundation.org/attachment.cgi?id=116888 Reviewed-on: https://gerrit.libreoffice.org/16557 Tested-by: Jenkins <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> (cherry picked from commit cb813b392d1f59ad8927b87e899d8a33d1db2504) Change-Id: I92ed3b7305bb5b714532f2dcffd615a8337db8b6 diff --git a/sw/source/core/uibase/app/docsh.cxx b/sw/source/core/uibase/app/docsh.cxx index ab5621d..4982994 100644 --- a/sw/source/core/uibase/app/docsh.cxx +++ b/sw/source/core/uibase/app/docsh.cxx @@ -1259,11 +1259,17 @@ const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const bool SwDocShell::IsChangeRecording() const { + if (!pWrtShell) + return false; + return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0; } bool SwDocShell::HasChangeRecordProtection() const { + if (!pWrtShell) + return false; + return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0; } commit f0e1c1da3260bfc971d0c9dedee5ed530712a36d Author: Caolán McNamara <[email protected]> Date: Mon Jun 29 11:26:41 2015 +0100 Resolves: tdf#92275 impress grinds to a halt constant swapping images This reverts commit 6c84442f99de109b585d3ba8964deb8dcf261c0f. "tdf#87820 Images not displayed properly in Calc" and replaces it with an alternative solution Change-Id: Iecb560d43767f0e41e442a307eefcdcecb7589ef (cherry picked from commit 2d196d0ee26b3840e56ec6537066a3b4a2f08691) (cherry picked from commit 72da6ef835982e1927fd7405bb42f403c2fee5f9) diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx index d706625..277451d5 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx @@ -134,22 +134,30 @@ namespace sdr rGrafObj.mbInsidePaint = false; } - // Invalidate paint areas. - GetViewContact().ActionChanged(); - bRetval = true; } } } else { - // it is not swapped out, somehow it was loaded. In that case, forget + // it is not swapped out, somehow[1] it was loaded. In that case, forget // about an existing triggered event - if(mpAsynchLoadEvent) + if (mpAsynchLoadEvent) { // just delete it, this will remove it from the EventHandler and // will trigger forgetAsynchGraphicLoadingEvent from the destructor delete mpAsynchLoadEvent; + + // Invalidate paint areas. + // [1] If a calc document with graphics is loaded then OnLoad will + // be emitted before the graphic are due to be swapped in asynchronously + // In sfx2 we generate a preview on receiving onload, which forces + // the graphics to be swapped in to generate the preview. When + // the timer triggers it find the graphics already swapped in. So + // we should still invalidate the paint area on finding the graphic + // swapped in seeing as we're still waiting in calc to draw the + // graphics on receipt of their contents. + GetViewContact().ActionChanged(); } } @@ -189,9 +197,6 @@ namespace sdr rGrafObj.mbInsidePaint = false; } - // Invalidate paint areas. - GetViewContact().ActionChanged(); - bRetval = true; } }
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
