core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2024-07-30 Thread Sarper Akdemir (via logerrit)
 sfx2/source/doc/docmacromode.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit e032a156e6b669d1c5423e21a42db326dc0f483d
Author: Sarper Akdemir 
AuthorDate: Tue Jun 11 12:39:36 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jul 30 22:48:13 2024 +0200

remove ability to trust not validated macro signatures in high security

Giving the user the option to determine if they should trust an
invalid signature in HIGH macro security doesn't make sense.
CommonName of the signature is the most prominent feature presented
and the CommonName of a certificate can be easily forged for an
invalid signature, tricking the user into accepting an invalid
signature.

in the HIGH macro security setting only show the pop-up to
enable/disable signed macro if the certificate signature can be
validated.

cherry-picked without UI/String altering bits for 24-2

Change-Id: Ia766fb701660160ee5dc9f6e077f4012a44ce721
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168667
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 
(cherry picked from commit 2beaa3be3829303e948d401f492dbfd239d60aad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169525
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 8a617b1785c6..997a8f739395 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -229,14 +229,18 @@ namespace sfx2
 // check whether the document is signed with trusted certificate
 if ( nMacroExecutionMode != MacroExecMode::FROM_LIST )
 {
+SignatureState nSignatureState = 
m_xData->m_rDocumentAccess.getScriptingSignatureState();
+
 // the trusted macro check will also retrieve the signature 
state ( small optimization )
 const SvtSecurityOptions aSecOption;
 const bool bAllowUIToAddAuthor = nMacroExecutionMode != 
MacroExecMode::FROM_LIST_AND_SIGNED_NO_WARN
  && (nMacroExecutionMode == 
MacroExecMode::ALWAYS_EXECUTE
- || 
!aSecOption.IsReadOnly(SvtSecurityOptions::EOption::MacroTrustedAuthors));
+ || 
!aSecOption.IsReadOnly(SvtSecurityOptions::EOption::MacroTrustedAuthors))
+ && (nMacroExecutionMode != 
MacroExecMode::FROM_LIST_AND_SIGNED_WARN
+ || nSignatureState == 
SignatureState::OK);
+
 const bool bHasTrustedMacroSignature = 
m_xData->m_rDocumentAccess.hasTrustedScriptingSignature(bAllowUIToAddAuthor);
 
-SignatureState nSignatureState = 
m_xData->m_rDocumentAccess.getScriptingSignatureState();
 if ( nSignatureState == SignatureState::BROKEN )
 {
 if (!bAllowUIToAddAuthor)


core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2024-06-25 Thread Onur Yilmaz (via logerrit)
 sfx2/source/doc/SfxRedactionHelper.cxx |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit afab434ede6cde5426b3b8760b221708211d6599
Author: Onur Yilmaz 
AuthorDate: Sun Jan 26 01:04:50 2020 +0300
Commit: Gabor Kelemen 
CommitDate: Tue Jun 25 07:08:44 2024 +0100

tdf#127169: Auto-redaction doesn't cover the title completely

Change-Id: I5283ce535f436f066859467cf6ef50ee9a2d2fdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87436
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 

diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx 
b/sfx2/source/doc/SfxRedactionHelper.cxx
index cdbc91f450af..f059f5aad074 100644
--- a/sfx2/source/doc/SfxRedactionHelper.cxx
+++ b/sfx2/source/doc/SfxRedactionHelper.cxx
@@ -159,9 +159,6 @@ tools::Rectangle ImplCalcActionBounds(const MetaAction& 
rAct, const OutputDevice
 aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).getX()
   + 
rOut.PixelToLogic(aBoundRect1).getWidth());
 }
-
-// FIXME: Is this really needed?
-aActionBounds.SetTop(aActionBounds.getY() + 100);
 }
 }
 break;
@@ -428,14 +425,15 @@ void SfxRedactionHelper::searchInMetaFile(const 
RedactionTarget* pRedactionTarge
 fillSearchOptions(aSearchOptions, pRedactionTarget);
 
 utl::TextSearch textSearch(aSearchOptions);
+static long aLastFontHeight = 0;
 
 MetaAction* pCurrAct;
 
-// Watch for TEXTARRAY actions.
-// They contain the text of paragraphs.
 for (pCurrAct = const_cast(rMtf).FirstAction(); pCurrAct;
  pCurrAct = const_cast(rMtf).NextAction())
 {
+// Watch for TEXTARRAY actions.
+// They contain the text of paragraphs.
 if (pCurrAct->GetType() == MetaActionType::TEXTARRAY)
 {
 MetaTextArrayAction* pMetaTextArrayAction = 
static_cast(pCurrAct);
@@ -456,7 +454,14 @@ void SfxRedactionHelper::searchInMetaFile(const 
RedactionTarget* pRedactionTarge
 ImplCalcActionBounds(*pMetaTextArrayAction, 
*pOutputDevice, nStart, nEnd));
 
 if (!aNewRect.IsEmpty())
+{
+// Calculate the difference between current wrong value 
and value should it be.
+// Add the difference to current value.
+// Then increase 10% of the new value to make it look 
better.
+aNewRect.SetTop(aNewRect.getY() + (aNewRect.getHeight() - 
aLastFontHeight)
+- aLastFontHeight / 10);
 aRedactionRectangles.push_back(aNewRect);
+}
 
 // Search for the next occurrence
 nStart = nEnd;
@@ -464,6 +469,11 @@ void SfxRedactionHelper::searchInMetaFile(const 
RedactionTarget* pRedactionTarge
 bFound = textSearch.SearchForward(sText, &nStart, &nEnd);
 }
 }
+else if (pCurrAct->GetType() == MetaActionType::FONT)
+{
+const MetaFontAction* pFontAct = static_cast(pCurrAct);
+aLastFontHeight = pFontAct->GetFont().GetFontSize().getHeight();
+}
 }
 }
 


core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2024-06-11 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/objmisc.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 0f9b5cd1c5e1e2a2ac389a3e9cd6b4f84bcb108e
Author: Michael Stahl 
AuthorDate: Wed Jun 5 18:53:05 2024 +0200
Commit: Michael Stahl 
CommitDate: Tue Jun 11 10:11:12 2024 +0200

tdf#157931 sfx2: fix modified status of Base forms

The problem is that when a Base form is not in design mode, it's not
expected that it will be stored.

There are checks for m_bOpenInDesign in ODocumentDefinition::save() and
ODocumentDefinition::saveAs() that were added in commit
9cfe62966ff1e0039d95a07d0c613675a53e3075 "CWS dba201b" but removing
these runs into another check in OCommonEmbeddedObject::storeOwn()
of m_bReadOnly and then it still fails, presumably because the storage
was opened readonly.

Let's restore SfxObjectShell::IsEnableSetModified() to check
IsReadOnly(), but only for Base form documents, which seems simplest.

(regression from commit bde746141f9b382156a5ce79ebf82c5e32fc455b)

Change-Id: I886389e2bd462d27ed5c46bfd2132893bb2d5a81
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168481
Reviewed-by: Michael Stahl 
Tested-by: Jenkins
(cherry picked from commit 3e7478ef9706e74ac551c1f94090e163e74c7fd8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168442
Reviewed-by: Thorsten Behrens 
(cherry picked from commit d6b881627cc1f6982129862e0221da65389d83bf)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 9ff78bff6eea..635fabd3b292 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -267,7 +267,13 @@ bool SfxObjectShell::IsEnableSetModified() const
 // which the user didn't load or activate to modified.
 return pImpl->m_bEnableSetModified && !IsPreview()
 && eCreateMode != SfxObjectCreateMode::ORGANIZER
-&& eCreateMode != SfxObjectCreateMode::INTERNAL;
+&& eCreateMode != SfxObjectCreateMode::INTERNAL
+// tdf#157931 form documents only in design mode
+&& ((pImpl->pBaseModel
+&& !pImpl->pBaseModel->impl_isDisposed()
+&& pImpl->pBaseModel->IsInitialized()
+&& pImpl->pBaseModel->getIdentifier() != 
"com.sun.star.sdb.FormDesign")
+|| !IsReadOnly());
 }
 
 


core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2024-05-07 Thread Balazs Varga (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 1e3d7374a2e70c56d082954d9ecad718b01c27fb
Author: Balazs Varga 
AuthorDate: Tue May 7 10:03:53 2024 +0200
Commit: Balazs Varga 
CommitDate: Tue May 7 17:08:49 2024 +0200

tdf#160961: hide open remote file button from startcenter if the

.uno:OpenRemote command is not available (e.g disabled in a config file).
We also hide the Open remote file (and other) buttons in the Menubar
if they are settled to disable.

cherry-picked from commit: 2fdcdad742bc26be509dde53f061f96a9620fd0a

Change-Id: I413e2c381ad5651c2cbef728bc5568fdcd746e9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167263
Tested-by: allotropia jenkins 
Reviewed-by: Balazs Varga 

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index e4059d50c275..41998fbfa8bd 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -30,6 +30,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -239,7 +240,14 @@ void BackingWindow::initControls()
 mpLocalView->ShowTooltips( true );
 
 setupButton( mpOpenButton );
-setupButton( mpRemoteButton );
+
+// Hide OpenRemote button on startpage if the OpenRemote uno command is 
not available
+SvtCommandOptions aCmdOptions;
+if (aCmdOptions.Lookup(SvtCommandOptions::CMDOPTION_DISABLED, 
"OpenRemote"))
+mpRemoteButton->Hide();
+else
+setupButton( mpRemoteButton );
+
 setupButton( mpRecentButton );
 setupButton( mpTemplateButton );
 setupButton( mpWriterAllButton );


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2023-06-28 Thread Michael Stahl (via logerrit)
 sfx2/source/view/viewfrm.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 61b0c6605932873ccf8ef321cbb41464d366cb70
Author: Michael Stahl 
AuthorDate: Tue Jun 27 19:50:51 2023 +0200
Commit: Michael Stahl 
CommitDate: Wed Jun 28 12:52:48 2023 +0200

tdf#146547 sfx2: preserve modified state from read-only to editable

SfxViewFrame::ExecReload_Impl() calls DoSaveCompleted() which resets the
modified state, but in this case the document wasn't actually saved.

Change-Id: I54f6508a652cc42a127bc59058c5b435dd1a25a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153676
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 79241a1fd32ab03cd2bb34fb303ce7f2fa93e57e)

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 2b39c4b1ef3c..bbfb37e5291d 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -330,9 +330,12 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
 m_pFrame->RemoveInfoBar("readonly");
 if (m_pMed)
 {
+bool const 
isEnableSetModified(m_pSh->IsEnableSetModified());
+m_pSh->EnableSetModified(false);
 // tdf#116066: DoSaveCompleted should be called 
after SetReadOnlyUI
 m_pSh->DoSaveCompleted(m_pMed);
 m_pSh->Broadcast(SfxHint(SfxHintId::ModeChanged));
+m_pSh->EnableSetModified(isEnableSetModified);
 }
 }
 }


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source starmath/qa

2023-05-24 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objmisc.cxx |3 ++-
 starmath/qa/cppunit/test_cursor.cxx |1 +
 starmath/qa/cppunit/test_node.cxx   |1 +
 starmath/qa/cppunit/test_nodetotextvisitors.cxx |1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit cb46fe877fd000ad74eb167a3a6127e89c8990f9
Author: Samuel Mehrbrodt 
AuthorDate: Mon May 8 15:41:27 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Wed May 24 22:28:04 2023 +0200

tdf#146547 Mark read-only docs as modified

when an editable section is changed.

Change-Id: I588b09f160974d3a3833bfa011fd07f2ee496616
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151535
Tested-by: Samuel Mehrbrodt 
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit e7e9991fd06ba2e0484ae5e6b6acc323ab8bf66b)

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index ff31ce956bbc..50f92ee65ac6 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -262,7 +262,8 @@ void SfxObjectShell::EnableSetModified( bool bEnable )
 
 bool SfxObjectShell::IsEnableSetModified() const
 {
-return pImpl->m_bEnableSetModified && !IsReadOnly();
+// Don't allow when user explicitly requested read only (IsLoadReadonly() 
or IsOriginallyLoadedReadOnlyMedium())
+return pImpl->m_bEnableSetModified && ! (IsLoadReadonly() || 
IsOriginallyLoadedReadOnlyMedium());
 }
 
 
diff --git a/starmath/qa/cppunit/test_cursor.cxx 
b/starmath/qa/cppunit/test_cursor.cxx
index 080e7a274c4d..b85b5ceef37a 100644
--- a/starmath/qa/cppunit/test_cursor.cxx
+++ b/starmath/qa/cppunit/test_cursor.cxx
@@ -57,6 +57,7 @@ void Test::setUp()
 SmGlobals::ensure();
 
 xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT);
+xDocShRef->DoInitNew();
 }
 
 void Test::tearDown()
diff --git a/starmath/qa/cppunit/test_node.cxx 
b/starmath/qa/cppunit/test_node.cxx
index dba0b9ff3c40..570cab00d062 100644
--- a/starmath/qa/cppunit/test_node.cxx
+++ b/starmath/qa/cppunit/test_node.cxx
@@ -53,6 +53,7 @@ void NodeTest::setUp()
 mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT |
 SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS |
 SfxModelFlags::DISABLE_DOCUMENT_RECOVERY);
+mxDocShell->DoInitNew();
 }
 
 void NodeTest::tearDown()
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx 
b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index c3172ab60126..e738351a8d23 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -90,6 +90,7 @@ void Test::setUp()
 SmGlobals::ensure();
 
 xDocShRef = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT);
+xDocShRef->DoInitNew();
 }
 
 void Test::tearDown()


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2023-03-15 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/iframe.cxx|4 
 sfx2/source/inc/eventsupplier.hxx |1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 6ce7620a163e9f03c3b4f43162a84e0347ae5b10
Author: Samuel Mehrbrodt 
AuthorDate: Mon Feb 27 15:27:24 2023 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Mar 16 01:52:20 2023 +

Check iframe target for allowed document URLs

Change-Id: I00e4192becbc160282a43ab89dcd269f3d1012d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147919
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 288c0920a8475f9f2c537212e04aa7649192ad8c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148230
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index aea851894286..c8c0c76357e7 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -174,6 +175,9 @@ sal_Bool SAL_CALL IFrameObject::load(
 return false;
 }
 
+if (!SfxEvents_Impl::isScriptURLAllowed(aTargetURL.Complete))
+return false;
+
 DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
 VclPtr pParent = VCLUnoHelper::GetWindow( 
xFrame->getContainerWindow() );
 VclPtr pWin = VclPtr::Create( 
pParent, maFrmDescr.IsFrameBorderOn() );
diff --git a/sfx2/source/inc/eventsupplier.hxx 
b/sfx2/source/inc/eventsupplier.hxx
index 4624ed8b4907..d24345dba1c5 100644
--- a/sfx2/source/inc/eventsupplier.hxx
+++ b/sfx2/source/inc/eventsupplier.hxx
@@ -87,7 +87,6 @@ public:
 SfxObjectShell* i_document );
 static void Execute( css::uno::Any const & aEventData, const 
css::document::DocumentEvent& aTrigger, SfxObjectShell* pDoc );
 
-private:
 /// Check if script URL whitelist exists, and if so, if current script url 
is part of it
 static bool isScriptURLAllowed(const OUString& aScriptURL);
 };


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-10-21 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/docfile.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 48fa1f49d97ce04c9d3749ae02b2874af6477e82
Author: Michael Stahl 
AuthorDate: Fri Oct 21 11:52:00 2022 +0200
Commit: Michael Stahl 
CommitDate: Fri Oct 21 12:01:11 2022 +0200

sfx2: avoid showing 2 dialogs in case WebDAV LOCK request fails

... with 403, also for the initial load of the document.

There is an Infobar anyway that the user can click to try again to
edit the document, and if that fails there will be a dialog that offers
opening a copy.

If opening a file:// document writable fails and it is opened read-only,
there is also no extra error dialog, just the Infobar, so this is making
WebDAV more consistent.

Change-Id: Ice62d167199f384b246b9d60dab4eed456a62288

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 6d10e2f6948d..8c0d101c4ea9 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1204,7 +1204,10 @@ SfxMedium::LockFileResult 
SfxMedium::LockOrigFileOnDemand(bool bLoading, bool bN
 if( !bResult )
 {
 uno::Reference< task::XInteractionHandler > xCHandler 
= GetInteractionHandler( true );
-if (bNoUI)
+// Dialog with error is superfluous:
+// on loading, will result in read-only with infobar.
+// bNoUI case for Reload failing, will open dialog 
later.
+if (bLoading || bNoUI)
 {
 xCHandler = new LockInteractionHandler(xCHandler);
 }


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-04-14 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objmisc.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 6520d6f9b09085af9c63d3c35108fb8083abbefa
Author: Samuel Mehrbrodt 
AuthorDate: Wed Apr 13 08:01:29 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:31:51 2022 +0200

Prevent save interception when sharing Calc doc

Using the dispatch mechanism means that this can be caught by the dispatch 
interceptor
which we don't want in this place.

Change-Id: Ie7e5f92e6043e2aff98d4887829a3573c12c6d08
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132946
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 4afaf1cc5d7b..04ff6ecd5314 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -113,6 +113,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "objstor.hxx"
@@ -521,9 +522,16 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool 
bSave )
 {
 // TODO/LATER: currently the application guards against the 
reentrance problem
 SetModified(); // the modified flag has to be set to let the 
document be stored with the shared flag
-const SfxPoolItem* pItem = 
pViewFrame->GetBindings().ExecuteSynchron( HasName() ? SID_SAVEDOC : 
SID_SAVEASDOC );
-const SfxBoolItem* pResult = dynamic_cast( 
pItem  );
-bResult = ( pResult && pResult->GetValue() );
+try
+{
+// Do *not* use dispatch mechanism in this place - we 
don't want others (extensions etc.) to intercept this.
+pImpl->pBaseModel->store();
+bResult = true;
+}
+catch (...)
+{
+bResult = false;
+}
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source svx/source

2022-01-31 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/appl/appserv.cxx |5 +
 svx/source/dialog/SafeModeDialog.cxx |2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit fcd156bd3a0e393ad3a546b8d3c16dcca832e2ed
Author: Samuel Mehrbrodt 
AuthorDate: Tue Feb 1 07:54:43 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Feb 1 07:54:43 2022 +0100

Fix support links

Change-Id: I000a8be2915005587e9e9d40f0da5d6834ef99f0

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 91fd8d941b58..400833f9dc79 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -549,10 +549,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 
 case SID_SEND_FEEDBACK:
 {
-OUString lang = 
Application::GetSettings().GetUILanguageTag().getLanguage();
-OUString sURL("https://libreoffice.cib.de/support_%1.html";);
-sURL = sURL.replaceFirst("%1", lang);
-sfx2::openUriExternally(sURL, false);
+sfx2::openUriExternally("https://libreoffice.cib.de";, false);
 break;
 }
 case SID_DOCUMENTATION:
diff --git a/svx/source/dialog/SafeModeDialog.cxx 
b/svx/source/dialog/SafeModeDialog.cxx
index da8dbd94fa59..981e7dfe5bab 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -92,7 +92,7 @@ SafeModeDialog::SafeModeDialog(weld::Window* pParent)
 
 // Set URL for help button (module=safemode)
 OUString lang = 
Application::GetSettings().GetUILanguageTag().getLanguage();
-OUString 
sURL("https://libreoffice.cib.de/support_%1.html&LOmodule=safemode";);
+OUString sURL("https://libreoffice.cib.de";);
 sURL = sURL.replaceFirst("%1", lang);
 mxBugLink->set_uri(sURL);
 


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-01-24 Thread Vasily Melenchuk (via logerrit)
 sfx2/source/appl/appserv.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 6c2ec06c264f9c8d2e8eab011e82c3bebfe26815
Author: Vasily Melenchuk 
AuthorDate: Mon Jan 24 19:49:30 2022 +0300
Commit: Vasily Melenchuk 
CommitDate: Mon Jan 24 19:49:30 2022 +0300

tdf#140020: fix patch for 6.4 version

Since 6.4 does not have 65404e2c72ea2 commit, we need another
implementation for isSaveLocked()

Change-Id: I76d68d57fe8af297bb7e57f86916aa52d531c783

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 0ddff776ff86..91fd8d941b58 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -236,6 +236,15 @@ namespace
 TOOLS_INFO_EXCEPTION( "sfx.appl", "trying to load bibliography 
database");
 }
 }
+bool lcl_isSaveLocked(SfxObjectShell * pShell)
+{
+assert(pShell);
+Reference xModel = pShell->GetModel();
+if (!xModel.is())
+return false;
+comphelper::NamedValueCollection aArgs(xModel->getArgs());
+return aArgs.getOrDefault("LockSave", false);
+}
 }
 /// Find the correct location of the document (CREDITS.fodt, etc.), and return
 /// it in rURL if found.
@@ -524,7 +533,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
   pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
 {
 SfxRequest aReq( SID_SAVEDOC, SfxCallMode::SLOT, 
pObjSh->GetPool() );
-if ( pObjSh->IsModified() && !pObjSh->isSaveLocked())
+if ( pObjSh->IsModified() && !lcl_isSaveLocked(pObjSh) )
 {
 pObjSh->ExecuteSlot( aReq );
 const SfxBoolItem *pItem = dynamic_cast( aReq.GetReturnValue()  );
@@ -1094,7 +1103,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
   pObjSh;
   pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
 {
-if ( pObjSh->IsModified() && !pObjSh->isSaveLocked() )
+if ( pObjSh->IsModified() && !lcl_isSaveLocked(pObjSh) 
)
 {
 bModified = true;
 break;


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source sfx2/uiconfig

2022-01-24 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |   50 ---
 sfx2/source/dialog/backingwindow.hxx |1 
 sfx2/uiconfig/ui/startcenter.ui  |   16 ---
 3 files changed, 67 deletions(-)

New commits:
commit ad8d4ad6a60d596f865f158ad53dee617a0a1b48
Author: Samuel Mehrbrodt 
AuthorDate: Thu Jan 20 17:24:06 2022 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Jan 24 10:22:26 2022 +0100

Remove external link from start center

Change-Id: I8deae6c5ea9af566d392a2f11830a0231d50aac9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128696
Tested-by: Thorsten Behrens 
Reviewed-by: Thorsten Behrens 

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index f9a11830e925..e4059d50c275 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -96,7 +96,6 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
 get(mpHelpButton, "help");
 //set an alternative help label that doesn't hotkey the H of the Help menu
 mpHelpButton->SetText(get("althelplabel")->GetText());
-get(mpExtensionsButton, "extensions");
 
 //Containers are invisible to cursor traversal
 //So on pressing "right" when in Help the
@@ -111,12 +110,7 @@ BackingWindow::BackingWindow( vcl::Window* i_pParent ) :
 //of a group, i.e. allow it to be grouped with the preceding
 //PushButton so when seen as a candidate by cursor travelling
 //it will be accepted as a continuation of the group.
-WinBits nBits = mpExtensionsButton->GetStyle();
-nBits &= ~WB_GROUP;
-nBits |= WB_NOGROUP;
-mpExtensionsButton->SetStyle(nBits);
 assert(mpHelpButton->GetStyle() & WB_GROUP);
-assert(!(mpExtensionsButton->GetStyle() & WB_GROUP));
 
 get(mpAllButtonsBox, "all_buttons_box");
 get(mpButtonsBox, "buttons_box");
@@ -188,7 +182,6 @@ void BackingWindow::dispose()
 mpDBAllButton.clear();
 mpMathAllButton.clear();
 mpHelpButton.clear();
-mpExtensionsButton.clear();
 mpAllButtonsBox.clear();
 mpButtonsBox.clear();
 mpSmallButtonsBox.clear();
@@ -258,8 +251,6 @@ void BackingWindow::initControls()
 
 checkInstalledModules();
 
-mpExtensionsButton->SetClickHdl(LINK(this, BackingWindow, 
ExtLinkClickHdl));
-
 // setup nice colors
 mpCreateLabel->SetControlForeground(maButtonsTextColor);
 vcl::Font 
aFont(mpCreateLabel->GetSettings().GetStyleSettings().GetLabelFont());
@@ -267,7 +258,6 @@ void BackingWindow::initControls()
 mpCreateLabel->SetControlFont(aFont);
 
 mpHelpButton->SetControlForeground(maButtonsTextColor);
-mpExtensionsButton->SetControlForeground(maButtonsTextColor);
 
 const Color 
aButtonsBackground(officecfg::Office::Common::Help::StartCenter::StartCenterBackgroundColor::get());
 
@@ -498,46 +488,6 @@ void BackingWindow::Resize()
 Invalidate();
 }
 
-IMPL_LINK(BackingWindow, ExtLinkClickHdl, Button*, pButton, void)
-{
-OUString aNode;
-
-if (pButton == mpExtensionsButton)
-aNode = "AddFeatureURL";
-
-if (aNode.isEmpty())
-return;
-
-try
-{
-uno::Sequence args(comphelper::InitAnyPropertySequence(
-{
-{"nodepath", 
uno::Any(OUString("/org.openoffice.Office.Common/Help/StartCenter"))}
-}));
-
-Reference xConfig = 
configuration::theDefaultProvider::get( 
comphelper::getProcessComponentContext() );
-Reference 
xNameAccess(xConfig->createInstanceWithArguments(SERVICENAME_CFGREADACCESS, 
args), UNO_QUERY);
-if (xNameAccess.is())
-{
-OUString sURL;
-Any value(xNameAccess->getByName(aNode));
-
-sURL = value.get();
-localizeWebserviceURI(sURL);
-
-Reference const
-xSystemShellExecute(
-css::system::SystemShellExecute::create(
-::comphelper::getProcessComponentContext()));
-xSystemShellExecute->execute(sURL, OUString(),
-css::system::SystemShellExecuteFlags::URIS_ONLY);
-}
-}
-catch (const Exception&)
-{
-}
-}
-
 IMPL_LINK( BackingWindow, ClickHdl, Button*, pButton, void )
 {
 // dispatch the appropriate URL and end the dialog
diff --git a/sfx2/source/dialog/backingwindow.hxx 
b/sfx2/source/dialog/backingwindow.hxx
index a4a5803a4804..9f12d29d1efc 100644
--- a/sfx2/source/dialog/backingwindow.hxx
+++ b/sfx2/source/dialog/backingwindow.hxx
@@ -70,7 +70,6 @@ class BackingWindow : public vcl::Window, public 
VclBuilderContainer
 VclPtr mpMathAllButton;
 
 VclPtr mpHelpButton;
-VclPtr mpExtensionsButton;
 
 VclPtr mpAllButtonsBox;
 VclPtr mpButtonsBox;
diff --git a/sfx2/uiconfig/ui/startcenter.ui b/sfx2/uiconfig/ui/startcenter.ui
index 4d2a328bd20d..2ece5a27b95f 100644
--- a/sfx2/uiconfig/ui/startcenter.ui
+++ b/sfx2/uiconfig/ui/startcenter.ui
@@ -449,22 +449,6 @@
 0
 

[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-01-24 Thread Vasily Melenchuk (via logerrit)
 sfx2/source/appl/appserv.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d6d3716fdccf2a0484b2c4b1425c3bb223893c8d
Author: Vasily Melenchuk 
AuthorDate: Thu Jan 20 14:16:40 2022 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jan 24 09:51:10 2022 +0100

tdf#140020: Disable also menu File->SaveAll for docs with LockSave

If LockSave attribute is applied, docs with it are not affecting
File->Save All menu item: these documents are not enabling this menu
and also not saved during this process.

Change-Id: I00bcd251fccfab3f13cb42c20ccb61b54ab49346
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128650
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Vasily Melenchuk 
(cherry picked from commit 87fe449c4c1ed46003e9d5fdaf1919f11a53b959)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128675
Tested-by: Samuel Mehrbrodt 

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 31f090bc3ee6..0ddff776ff86 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -524,7 +524,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
   pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
 {
 SfxRequest aReq( SID_SAVEDOC, SfxCallMode::SLOT, 
pObjSh->GetPool() );
-if ( pObjSh->IsModified() )
+if ( pObjSh->IsModified() && !pObjSh->isSaveLocked())
 {
 pObjSh->ExecuteSlot( aReq );
 const SfxBoolItem *pItem = dynamic_cast( aReq.GetReturnValue()  );
@@ -1094,7 +1094,7 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
   pObjSh;
   pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
 {
-if ( pObjSh->IsModified() )
+if ( pObjSh->IsModified() && !pObjSh->isSaveLocked() )
 {
 bModified = true;
 break;


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-01-20 Thread Vasily Melenchuk (via logerrit)
 sfx2/source/view/viewsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e4f77638cd44cb1d59a8ce670b3c23462d147839
Author: Vasily Melenchuk 
AuthorDate: Tue Jan 18 12:50:01 2022 +0300
Commit: Samuel Mehrbrodt 
CommitDate: Thu Jan 20 17:14:10 2022 +0100

tdf#140019: Revert "Don't disable "Send doc via email" ..."

Locked export should also disable ability to send document.

This reverts commit b9930d0d05db39a8466b18dccf626bc3d8ae5c4e.

Change-Id: I3b7b423c0e17a59872065ec7ceadbaf1cda45ccc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128550
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
Reviewed-by: Vasily Melenchuk 
(cherry picked from commit f4559274154324e132f82ba9c21676326f6db7e5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128664
Tested-by: Samuel Mehrbrodt 

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 8a199623fa58..80cd8a122d07 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -684,7 +684,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet )
 #if HAVE_FEATURE_MACOSX_SANDBOX
 rSet.DisableItem(nSID);
 #endif
-if (isExportLocked() && nSID != SID_MAIL_SENDDOC)
+if (isExportLocked())
 rSet.DisableItem(nSID);
 break;
 }


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2022-01-18 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/doc/objstor.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 46e48a45cd9251df12feee30a194708bcb3ba8bb
Author: Samuel Mehrbrodt 
AuthorDate: Tue Feb 4 10:36:09 2020 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Tue Jan 18 15:44:35 2022 +0100

Allow opt-out from document events check

Commit b3edf85e0fe6ca03dc26e1bf531be82193bc9627 added a warning on load
when a document binds events to a macro.

This adds an option to restore the old behavior, so that the warning only
appears when a document actually has Macros.

Change-Id: I5ad398d3d503a0954a746f4cba150f68630b820c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87961
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit c161478ed50f6ee8878335db113f8850a136615b)

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ab3dee35e5c2..b232a286900d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3623,7 +3623,9 @@ void SfxObjectShell::SetMacroCallsSeenWhileLoading()
 
 bool SfxObjectShell::GetMacroCallsSeenWhileLoading() const
 {
-return pImpl->m_bMacroCallsSeenWhileLoading;
+if 
(officecfg::Office::Common::Security::Scripting::CheckDocumentEvents::get())
+return pImpl->m_bMacroCallsSeenWhileLoading;
+return false;
 }
 
 bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< 
task::XInteractionHandler >& xHandler )


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - sfx2/source

2020-12-11 Thread Samuel Mehrbrodt (via logerrit)
 sfx2/source/appl/appserv.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c103dfb9923e2ddb0bd85e21f2f31d5267a93a66
Author: Samuel Mehrbrodt 
AuthorDate: Thu Dec 10 17:24:53 2020 +0100
Commit: Vasily Melenchuk 
CommitDate: Fri Dec 11 09:16:46 2020 +0100

Fix Linux build

Change-Id: Ic6ba805b8920316f0a549678e10f7fe71bf46d04
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107567
Tested-by: Vasily Melenchuk 
Reviewed-by: Vasily Melenchuk 

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 9577fc4d4d6f..f15e39282682 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -61,6 +61,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits