core.git: Branch 'libreoffice-24-2' - sfx2/source

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

New commits:
commit d6b881627cc1f6982129862e0221da65389d83bf
Author: Michael Stahl 
AuthorDate: Wed Jun 5 18:53:05 2024 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Jun 11 00:50:23 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 

diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 234ae799caeb..9ef1469687b3 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -256,7 +256,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 'libreoffice-24-2' - sfx2/source

2024-05-23 Thread Xisco Fauli (via logerrit)
 sfx2/source/control/bindings.cxx |3 +++
 sfx2/source/control/dispatch.cxx |   16 +---
 sfx2/source/view/viewfrm.cxx |4 ++--
 3 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit 63870676cda0f36c3763869dfb0fed49da0a2104
Author: Xisco Fauli 
AuthorDate: Wed May 22 10:17:20 2024 +0200
Commit: Xisco Fauli 
CommitDate: Thu May 23 12:08:02 2024 +0200

sfx2: warning C6011: Dereferencing NULL pointer

Change-Id: Ie65284c3ded0c5789f0be5bbd770d190a92fecec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167922
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167981
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 47ddda28136f..8beca9364e71 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -945,6 +945,9 @@ SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 
nId, const SfxPoolItem**
 if ( dynamic_cast< const SfxModule *>( pShell ) == nullptr && 
dynamic_cast< const SfxApplication *>( pShell ) == nullptr && dynamic_cast< 
const SfxViewFrame *>( pShell ) == nullptr )
 return SfxPoolItemHolder();
 
+if (!pShell)
+return SfxPoolItemHolder();
+
 SfxItemPool  = pShell->GetPool();
 SfxRequest aReq( nId, nCallMode, rPool );
 aReq.SetModifier( nModi );
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index fe7271677fbf..bedad9a6241a 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -707,7 +707,7 @@ bool SfxDispatcher::GetShellAndSlot_Impl(sal_uInt16 nSlot, 
SfxShell** ppShell,
 
 *ppShell = GetShell(aSvr.GetShellLevel());
 *ppSlot = aSvr.GetSlot();
-if ( nullptr == (*ppSlot)->GetExecFnc() && bRealSlot )
+if ( nullptr == (*ppSlot)->GetExecFnc() && bRealSlot && *ppShell )
 *ppSlot = (*ppShell)->GetInterface()->GetRealSlot(*ppSlot);
 // Check only real slots as enum slots don't have an execute function!
 return !bRealSlot || ((nullptr != *ppSlot) && (nullptr != 
(*ppSlot)->GetExecFnc()) );
@@ -986,13 +986,15 @@ void 
SfxDispatcher::PostMsgHandler(std::unique_ptr pReq)
 SfxSlotServer aSvr;
 if ( FindServer_(pReq->GetSlot(), aSvr ) ) // HACK(x), whatever that 
was supposed to mean
 {
-const SfxSlot *pSlot = aSvr.GetSlot();
-SfxShell *pSh = GetShell(aSvr.GetShellLevel());
+if (SfxShell *pSh = GetShell(aSvr.GetShellLevel()))
+{
+const SfxSlot *pSlot = aSvr.GetSlot();
 
-// When the pSlot is a "Pseudoslot" for macros or Verbs, it can
-// be destroyed in the Call_Impl, thus do not use it anymore!
-pReq->SetSynchronCall( false );
-Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! why 
bRecord?
+// When the pSlot is a "Pseudoslot" for macros or Verbs, it can
+// be destroyed in the Call_Impl, thus do not use it anymore!
+pReq->SetSynchronCall( false );
+Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! 
why bRecord?
+}
 }
 }
 else
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index b14ff206fa96..202064f13081 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1093,8 +1093,8 @@ void SfxViewFrame::PopShellAndSubShells_Impl( 
SfxViewShell& i_rViewShell )
 if ( nLevel )
 {
 // more sub shells on the stack, which were not affected by 
PopSubShells_Impl
-SfxShell *pSubShell = m_pDispatcher->GetShell( nLevel-1 );
-m_pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | 
SfxDispatcherPopFlags::POP_DELETE );
+if (SfxShell *pSubShell = m_pDispatcher->GetShell( nLevel-1 ))
+m_pDispatcher->Pop( *pSubShell, 
SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE );
 }
 m_pDispatcher->Pop( i_rViewShell );
 m_pDispatcher->Flush();


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-04-30 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/shutdowniconw32.cxx |   15 ---
 sfx2/source/doc/syspathw32.cxx   |   21 +++--
 2 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit 1ddc294779d81ce2a00b75d283f183890074e650
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 11:42:35 2024 +0100
Commit: Michael Stahl 
CommitDate: Tue Apr 30 11:19:15 2024 +0200

Unchecked HeapAlloc

Change-Id: Icd49d0b5f996d57d8e9518cb08fd3c3fc54fa779
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166732
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit a70a8f55973ec3e71f65335be75699f1d2a73d62)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166833
Reviewed-by: Michael Stahl 

diff --git a/sfx2/source/appl/shutdowniconw32.cxx 
b/sfx2/source/appl/shutdowniconw32.cxx
index 2fb7cd2b7875..a237aac13547 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -681,15 +681,16 @@ static OUString SHGetSpecialFolder( int nFolderID )
 
 if( hHdl == NOERROR )
 {
-WCHAR *lpFolderA;
-lpFolderA = ALLOC( WCHAR, 16000 );
-
-SHGetPathFromIDListW( pidl, lpFolderA );
-aFolder = o3tl::toU( lpFolderA );
+if (WCHAR *lpFolderA = ALLOC(WCHAR, 16000))
+{
+SHGetPathFromIDListW(pidl, lpFolderA);
+aFolder = o3tl::toU(lpFolderA);
 
-FREE( lpFolderA );
-SHFree_( pidl );
+FREE(lpFolderA);
+SHFree_(pidl);
+}
 }
+
 return aFolder;
 }
 
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index f60f459829d7..dce19e3625c0 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -37,17 +37,18 @@ static bool SHGetSpecialFolderW32( int nFolderID, WCHAR* 
pszFolder, int nSize )
 
 if( hHdl == NOERROR )
 {
-WCHAR *lpFolder = static_cast< WCHAR* >( HeapAlloc( GetProcessHeap(), 
0, 16000 ));
-
-SHGetPathFromIDListW( pidl, lpFolder );
-wcsncpy( pszFolder, lpFolder, nSize );
-
-HeapFree( GetProcessHeap(), 0, lpFolder );
-IMalloc *pMalloc;
-if( NOERROR == SHGetMalloc() )
+if (WCHAR *lpFolder = static_cast(HeapAlloc(GetProcessHeap(), 
0, 16000)))
 {
-pMalloc->Free( pidl );
-pMalloc->Release();
+SHGetPathFromIDListW( pidl, lpFolder );
+wcsncpy( pszFolder, lpFolder, nSize );
+
+HeapFree( GetProcessHeap(), 0, lpFolder );
+IMalloc *pMalloc;
+if( NOERROR == SHGetMalloc() )
+{
+pMalloc->Free( pidl );
+pMalloc->Release();
+}
 }
 }
 return true;


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/appopen.cxx   |5 +++--
 sfx2/source/doc/objserv.cxx|6 +-
 sfx2/source/notebookbar/SfxNotebookBar.cxx |   14 +-
 3 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit b18b3b51a7d397a16e85bf8ba83b27193c7cc8c5
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 10:20:56 2024 +0100
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 15:27:39 2024 +0200

SfxViewFrame::Current() dereferenced without null check

found with msvc -analyze and _Ret_maybenull_

Change-Id: Ia377822e93448dc61acd1482d34167c35a46836b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166705
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 95d3e0d478686c7fa84f0bb8c466a1082333a47b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166830
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 4e1b06e52268..37c67e1ef293 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1044,9 +1044,10 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 if( aFileName.startsWith("#") ) // Mark without URL
 {
 SfxViewFrame *pView = pTargetFrame ? 
pTargetFrame->GetCurrentViewFrame() : nullptr;
-if ( !pView )
+if (!pView)
 pView = SfxViewFrame::Current();
-pView->GetViewShell()->JumpToMark( aFileName.copy(1) );
+if (pView)
+pView->GetViewShell()->JumpToMark( aFileName.copy(1) );
 rReq.SetReturnValue( SfxViewFrameItem( pView ) );
 return;
 }
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index fedbfb205d92..90ef2ee232e7 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -453,6 +453,10 @@ static void sendErrorToLOK(ErrCodeMsg error)
 if (error.GetCode().GetClass() == ErrCodeClass::NONE)
 return;
 
+SfxViewShell* pNotifier = SfxViewShell::Current();
+if (!pNotifier)
+return;
+
 boost::property_tree::ptree aTree;
 aTree.put("code", error);
 aTree.put("kind", "");
@@ -465,7 +469,7 @@ static void sendErrorToLOK(ErrCodeMsg error)
 std::stringstream aStream;
 boost::property_tree::write_json(aStream, aTree);
 
-SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
OString(aStream.str()));
+pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, 
OString(aStream.str()));
 }
 
 namespace
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 8e9c2c9ca494..69d41b04d825 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -418,6 +418,9 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 
 if (bIsLOK)
 {
+if (!pViewShell)
+return false;
+
 // Notebookbar was loaded too early what caused:
 //   * in LOK: Paste Special feature was incorrectly 
initialized
 // Skip first request so Notebookbar will be initialized after 
document was loaded
@@ -608,11 +611,12 @@ void SfxNotebookBar::ToggleMenubar()
 
 void SfxNotebookBar::ReloadNotebookBar(std::u16string_view sUIPath)
 {
-if (SfxNotebookBar::IsActive())
-{
-SfxViewShell* pViewShell = SfxViewShell::Current();
-
sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), 
sUIPath, true);
-}
+if (!SfxNotebookBar::IsActive())
+return;
+SfxViewShell* pViewShell = SfxViewShell::Current();
+if (!pViewShell)
+return;
+
sfx2::SfxNotebookBar::StateMethod(pViewShell->GetViewFrame().GetBindings(), 
sUIPath, true);
 }
 
 IMPL_STATIC_LINK(SfxNotebookBar, VclDisposeHdl, const SfxViewShell*, 
pViewShell, void)


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-04-29 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/graphhelp.cxx |   41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

New commits:
commit 5582ea36163d060887ff319baaf817f8581fe0db
Author: Caolán McNamara 
AuthorDate: Fri Apr 26 11:11:44 2024 +0100
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 12:23:20 2024 +0200

WaE: C6011 Derefencing NULL pointer 'pMF'

Change-Id: I76e85e8671623f7cdf994dce779c3944b8761acf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166731
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit e5c988821db31f285cdd207e2a2ac849c0f1c099)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166832
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 7cfdf76fe60f..9d7600ae2da7 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -128,28 +128,29 @@ void* GraphicHelper::getWinMetaFileFromGDI_Impl( const 
GDIMetaFile* pGDIMeta, co
 
 if ( hMemory )
 {
-METAFILEPICT* pMF = 
static_cast(GlobalLock( hMemory ));
-
-pMF->hMF = hMeta;
-pMF->mm = MM_ANISOTROPIC;
-
-MapMode aWinMode( MapUnit::Map100thMM );
-
-if ( aWinMode == pGDIMeta->GetPrefMapMode() )
+if (METAFILEPICT* pMF = 
static_cast(GlobalLock(hMemory)))
 {
-pMF->xExt = aMetaSize.Width();
-pMF->yExt = aMetaSize.Height();
+pMF->hMF = hMeta;
+pMF->mm = MM_ANISOTROPIC;
+
+MapMode aWinMode( MapUnit::Map100thMM );
+
+if ( aWinMode == pGDIMeta->GetPrefMapMode() )
+{
+pMF->xExt = aMetaSize.Width();
+pMF->yExt = aMetaSize.Height();
+}
+else
+{
+Size aWinSize = OutputDevice::LogicToLogic( 
Size( aMetaSize.Width(), aMetaSize.Height() ),
+
pGDIMeta->GetPrefMapMode(),
+
aWinMode );
+pMF->xExt = aWinSize.Width();
+pMF->yExt = aWinSize.Height();
+}
+
+GlobalUnlock(hMemory);
 }
-else
-{
-Size aWinSize = OutputDevice::LogicToLogic( Size( 
aMetaSize.Width(), aMetaSize.Height() ),
-
pGDIMeta->GetPrefMapMode(),
-
aWinMode );
-pMF->xExt = aWinSize.Width();
-pMF->yExt = aWinSize.Height();
-}
-
-GlobalUnlock( hMemory );
 pResult = static_cast(hMemory);
 }
 else


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-04-29 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/objstor.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 2ed402dada3b8b64c6f23cf5afc068848ab1a528
Author: Julien Nabet 
AuthorDate: Sun Apr 28 13:16:59 2024 +0200
Commit: Xisco Fauli 
CommitDate: Mon Apr 29 10:23:51 2024 +0200

tdf#160827: fix crash when retrieving _MarkAsFinal value (docx) (take 2)

Change-Id: I3f2ad56a205877be54b0dbfe361b76db3436f5ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166798
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins
(cherry picked from commit 45d2d90d2354a6a32297cde52c0041915499b19b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166726
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 17ee6bf6217d..a6aaee75ea87 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2428,7 +2428,11 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
 uno::Reference xPropertySetInfo = 
xPropertySet->getPropertySetInfo();
 if (xPropertySetInfo.is() && 
xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
 {
-if 
(xPropertySet->getPropertyValue("_MarkAsFinal").get())
+Any anyMarkAsFinal = 
xPropertySet->getPropertyValue("_MarkAsFinal");
+if (
+   ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType::get()) && (anyMarkAsFinal.get()) ) ||
+   ( (anyMarkAsFinal.getValueType() == 
cppu::UnoType::get()) && (anyMarkAsFinal.get() == "true") )
+)
 {
 uno::Reference< lang::XMultiServiceFactory > 
xFactory(GetModel(), uno::UNO_QUERY);
 uno::Reference< beans::XPropertySet > 
xSettings(xFactory->createInstance("com.sun.star.document.Settings"), 
uno::UNO_QUERY);


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-03-28 Thread Caolán McNamara (via logerrit)
 sfx2/source/sidebar/SidebarDockingWindow.cxx |  117 +--
 1 file changed, 60 insertions(+), 57 deletions(-)

New commits:
commit 13148df8d8dfa4bac33a574deea7bd0065ca5140
Author: Caolán McNamara 
AuthorDate: Thu Mar 28 11:23:56 2024 +
Commit: Xisco Fauli 
CommitDate: Thu Mar 28 19:42:09 2024 +0100

null deref of mpSidebarController

follow the pattern used in the rest of this and skip the branch
that depends on mpSidebarController existing

git show -w

Change-Id: I739754b2af7ad09fa80c36693d8adbf173ece2e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165426
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit d4d923f9db926d8b0b6eb3bb7b62f5a7a520c00d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165470
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 23c3b459c3be..d0edf8066332 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -136,75 +136,78 @@ SfxChildAlignment SidebarDockingWindow::CheckAlignment (
 
 bool SidebarDockingWindow::EventNotify(NotifyEvent& rEvent)
 {
-NotifyEventType nType = rEvent.GetType();
-if (NotifyEventType::KEYINPUT == nType)
+if (mpSidebarController)
 {
-const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
-switch (rKeyCode.GetCode())
+NotifyEventType nType = rEvent.GetType();
+if (NotifyEventType::KEYINPUT == nType)
 {
-case KEY_UP:
-case KEY_DOWN:
-case KEY_PAGEUP:
-case KEY_PAGEDOWN:
-case KEY_HOME:
-case KEY_END:
-case KEY_LEFT:
-case KEY_RIGHT:
-case KEY_BACKSPACE:
-case KEY_DELETE:
-case KEY_INSERT:
-case KEY_RETURN:
-case KEY_ESCAPE:
+const vcl::KeyCode& rKeyCode = rEvent.GetKeyEvent()->GetKeyCode();
+switch (rKeyCode.GetCode())
 {
+case KEY_UP:
+case KEY_DOWN:
+case KEY_PAGEUP:
+case KEY_PAGEDOWN:
+case KEY_HOME:
+case KEY_END:
+case KEY_LEFT:
+case KEY_RIGHT:
+case KEY_BACKSPACE:
+case KEY_DELETE:
+case KEY_INSERT:
+case KEY_RETURN:
+case KEY_ESCAPE:
+{
+return true;
+}
+default:
+break;
+}
+if (!mpAccel)
+{
+mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
+mpAccel->init(comphelper::getProcessComponentContext(), 
mpSidebarController->getXFrame());
+}
+const OUString 
aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
+if (".uno:DesignerDialog" == aCommand)
+{
+std::shared_ptr xPanelDescriptor =
+
mpSidebarController->GetResourceManager()->GetPanelDescriptor( 
u"StyleListPanel" );
+if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( 
xPanelDescriptor->msDeckId ) )
+Close();
+return true;
+}
+if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+{
+comphelper::dispatchCommand(aCommand, {});
 return true;
 }
-default:
-break;
-}
-if (!mpAccel)
-{
-mpAccel = svt::AcceleratorExecute::createAcceleratorHelper();
-mpAccel->init(comphelper::getProcessComponentContext(), 
mpSidebarController->getXFrame());
-}
-const OUString 
aCommand(mpAccel->findCommand(svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyCode)));
-if (".uno:DesignerDialog" == aCommand)
-{
-std::shared_ptr xPanelDescriptor =
-
mpSidebarController->GetResourceManager()->GetPanelDescriptor( 
u"StyleListPanel" );
-if ( xPanelDescriptor && mpSidebarController->IsDeckVisible( 
xPanelDescriptor->msDeckId ) )
-Close();
-return true;
 }
-if (".uno:Undo" == aCommand || ".uno:Redo" == aCommand)
+else if (NotifyEventType::MOUSEBUTTONDOWN == nType)
 {
-comphelper::dispatchCommand(aCommand, {});
-return true;
+const MouseEvent *mEvt = rEvent.GetMouseEvent();
+if (mEvt->IsLeft())
+{
+tools::Rectangle aGrip = 
mpSidebarController->GetDeckDragArea();
+if ( aGrip.Contains( mEvt->GetPosPixel() ) )
+mbIsReadyToDrag = true;
+}
 }
-}
-else if 

core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-02-28 Thread Heiko Tietze (via logerrit)
 sfx2/source/view/viewfrm.cxx |  173 ++-
 1 file changed, 92 insertions(+), 81 deletions(-)

New commits:
commit 9b0ec6639e7218b93551fc680b0929a73ac1fd90
Author: Heiko Tietze 
AuthorDate: Wed Feb 28 10:30:48 2024 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Feb 28 22:27:07 2024 +0100

Resolves tdf#131550 - Suppress Donate/Involve infobar if another is visible

Change-Id: I013f0a1f0aa020f10d6beb21940959508eba4547
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164082
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit 607740654f2264e13469e4da1d020448217d7222)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164114
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c6b25637ccf3..b14ff206fa96 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1496,88 +1496,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint )
 rBind.Invalidate( SID_RELOAD );
 rBind.Invalidate( SID_EDITDOC );
 
-#if !ENABLE_WASM_STRIP_PINGUSER
-bool bIsHeadlessOrUITest = 
SfxApplication::IsHeadlessOrUITest(); //uitest.uicheck fails when the dialog is 
open
-
-//what's new infobar
-if (utl::isProductVersionUpgraded(true) && 
!bIsHeadlessOrUITest)
-{
-VclPtr pInfoBar = 
AppendInfoBar("whatsnew", "", SfxResId(STR_WHATSNEW_TEXT), InfobarType::INFO);
-if (pInfoBar)
-{
-weld::Button& rWhatsNewButton = pInfoBar->addButton();
-
rWhatsNewButton.set_label(SfxResId(STR_WHATSNEW_BUTTON));
-rWhatsNewButton.connect_clicked(LINK(this, 
SfxViewFrame, WhatsNewHandler));
-}
-}
-
-// show tip-of-the-day dialog if it due, but not if there is 
the impress modal template dialog
-// open where SdModule::ExecuteNewDocument will launch it 
instead when that dialog is dismissed
-if (SfxApplication::IsTipOfTheDayDue() && !bIsHeadlessOrUITest 
&& !IsInModalMode())
-{
-// tdf#127946 pass in argument for dialog parent
-SfxUnoFrameItem aDocFrame(SID_FILLFRAME, 
GetFrame().GetFrameInterface());
-GetDispatcher()->ExecuteList(SID_TIPOFTHEDAY, 
SfxCallMode::SLOT, {}, {  });
-}
-
-// inform about the community involvement
-const auto t0 = 
std::chrono::system_clock::now().time_since_epoch();
-const sal_Int64 nLastGetInvolvedShown = 
officecfg::Setup::Product::LastTimeGetInvolvedShown::get();
-const sal_Int64 nNow = 
std::chrono::duration_cast(t0).count();
-const sal_Int64 nPeriodSec(60 * 60 * 24 * 180); // 180 days in 
seconds
-bool bUpdateLastTimeGetInvolvedShown = false;
-
-if (nLastGetInvolvedShown == 0)
-bUpdateLastTimeGetInvolvedShown = true;
-else if (nPeriodSec < nNow && nLastGetInvolvedShown < (nNow + 
nPeriodSec/2) - nPeriodSec) // 90d alternating with donation
-{
-bUpdateLastTimeGetInvolvedShown = true;
-
-VclPtr pInfoBar = 
AppendInfoBar("getinvolved", "", SfxResId(STR_GET_INVOLVED_TEXT), 
InfobarType::INFO);
-
-if (pInfoBar)
-{
-weld::Button& rGetInvolvedButton = 
pInfoBar->addButton();
-
rGetInvolvedButton.set_label(SfxResId(STR_GET_INVOLVED_BUTTON));
-rGetInvolvedButton.connect_clicked(LINK(this, 
SfxViewFrame, GetInvolvedHandler));
-}
-}
-
-if (bUpdateLastTimeGetInvolvedShown
-&& 
!officecfg::Setup::Product::LastTimeGetInvolvedShown::isReadOnly())
-{
-std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
-
officecfg::Setup::Product::LastTimeGetInvolvedShown::set(nNow, batch);
-batch->commit();
-}
-
-// inform about donations
-const sal_Int64 nLastDonateShown = 
officecfg::Setup::Product::LastTimeDonateShown::get();
-bool bUpdateLastTimeDonateShown = false;
-
-if (nLastDonateShown == 0)
-bUpdateLastTimeDonateShown = true;
-else if (nPeriodSec < nNow && nLastDonateShown < nNow - 
nPeriodSec) // 90d alternating with getinvolved
-{
-bUpdateLastTimeDonateShown = true;
-
-VclPtr pInfoBar = 
AppendInfoBar("donate", "", SfxResId(STR_DONATE_TEXT), InfobarType::INFO);
-if 

core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-02-14 Thread Julien Nabet (via logerrit)
 sfx2/source/doc/sfxbasemodel.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 39fa034db32fa07a7f2a7afe77f7d1c047b5cad8
Author: Julien Nabet 
AuthorDate: Wed Feb 14 10:21:20 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 14 17:37:42 2024 +0100

tdf#159707: fix crash when changing to edit mode (calc)

bt:
0x7f9eb4b902f2 in 
com::sun::star::uno::Reference::operator->() 
const (this=0x55b8c2b54888) at include/com/sun/star/uno/Reference.h:387
0x7f9eb4c03584 in 
ScVbaEventsHelper::notifyEvent(com::sun::star::document::EventObject const&) 
(this=0x55b8c2b54840, rEvent=...) at 
/home/julien/lo/libreoffice/sc/source/ui/vba/vbaeventshelper.cxx:605
0x7f9ef464bd3c in (anonymous 
namespace)::NotifySingleListenerIgnoreRE::operator()(com::sun::star::uno::Reference
 const&) const (this=0x7ffc5044dfc0, listener=uno::Reference to 
(ScVbaEventsHelper *) 0x55b8c2b54870) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3293
0x7f9ef463b8aa in 
comphelper::OInterfaceContainerHelper3::forEach<(anonymous
 
namespace)::NotifySingleListenerIgnoreRE >((anonymous 
namespace)::NotifySingleListenerIgnoreRE const&)
(this=0x55b8c2735c18, func=...) at 
include/comphelper/interfacecontainer3.hxx:279
0x7f9ef463b010 in SfxBaseModel::postEvent_Impl(rtl::OUString const&, 
com::sun::star::uno::Reference const&, 
com::sun::star::uno::Any const&)
(this=0x55b8c2308ae0, aName="OnUnload", xController=empty uno::Reference, 
supplement=uno::Any(void)) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:3338
0x7f9ef463a089 in SfxBaseModel::Notify(SfxBroadcaster&, SfxHint const&) 
(this=0x55b8c2308ae0, rBC=..., rHint=...) at 
/home/julien/lo/libreoffice/sfx2/source/doc/sfxbasemodel.cxx:2960

See full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=192546

Regression from:

https://git.libreoffice.org/core/+/d2fccf0117a37f8aab8bb50ece419987f06af6b9%5E%21
"cool#6893 improve listeners in SfxBaseModel"

Change-Id: I372808dade20c47275ab599054d8e9572dc3da4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163356
Reviewed-by: Julien Nabet 
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
(cherry picked from commit 6c6b580428bc527da9af82da743616787617b39b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163344
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 985af531358d..062c594f2c4f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2510,7 +2510,7 @@ void SAL_CALL SfxBaseModel::removeEventListener( const 
Reference< document::XEve
 {
 SfxModelGuard aGuard( *this );
 
-m_pData->m_aEventListeners.removeInterface( aListener );
+m_pData->m_aDocumentEventListeners1.removeInterface( aListener );
 }
 
 //  XShapeEventBroadcaster


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-02-08 Thread Andras Timar (via logerrit)
 sfx2/source/appl/sfxhelp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 3eb73e8bca02d2f0b16bc38c880dc529c83e23bc
Author: Andras Timar 
AuthorDate: Fri Jan 19 15:49:49 2024 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Feb 8 13:31:13 2024 +0100

LOK: disable popup bubble for hyperlinks

Change-Id: I0ca21a90561affa453bd249c86e58793618f809e
(cherry picked from commit 88fea772610a4feef018ba03fd19749841772225)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162287
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index b596a4e33efa..785872ddee0b 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -665,6 +665,10 @@ OUString SfxHelp::GetHelpText(const OUString& aCommandURL, 
const weld::Widget* p
 
 OUString SfxHelp::GetURLHelpText(std::u16string_view aURL)
 {
+// hyperlinks are handled differently in Online
+if (comphelper::LibreOfficeKit::isActive())
+return OUString();
+
 bool bCtrlClickHlink = 
SvtSecurityOptions::IsOptionSet(SvtSecurityOptions::EOption::CtrlClickHyperlink);
 
 // "ctrl-click to follow link:" for not MacOS


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-02-02 Thread Mike Kaganski (via logerrit)
 sfx2/source/doc/objstor.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c07f2a047e9201bbc0c2d55a2dada264b2094846
Author: Mike Kaganski 
AuthorDate: Thu Feb 1 13:35:43 2024 +0600
Commit: Michael Stahl 
CommitDate: Fri Feb 2 13:19:43 2024 +0100

tdf#159496: clear mxObjectContainer in PrepareSecondTryLoad_Impl

The problem here is that the object container has own reference to the
storage object. In SfxBaseModel::load, when preparing for a second try,
the storage gets disposed, and a cleanup is performed; but previously,
the reference to the disposed storage was used in the object container,
and thus generated a failure when it was used to import the OLE.

Clearing it allows to re-create it properly, with the updated storage.

Change-Id: I08b7503d79240ccc51b253fe1f4e99a0232995b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162866
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 6bddbe51cee5c4aea023cc68771800f46a4aad2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162828
Reviewed-by: Michael Stahl 

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index ea1063ea81c1..17ee6bf6217d 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -400,6 +400,7 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl()
 {
 // only for internal use
 pImpl->m_xDocStorage.clear();
+pImpl->mxObjectContainer.reset();
 pImpl->m_bIsInit = false;
 ResetError();
 }


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-01-24 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c36bb3f22a55af0066b0d81a966ef8932d20bf7b
Author: Xisco Fauli 
AuthorDate: Wed Jan 24 10:03:53 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 21:41:33 2024 +0100

sfx2: check SfxViewShell::Current()

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/52df6de5-7ea8-48e4-8c45-f18b02d9a767

Change-Id: I56c17234a0f82797d37e26b0c39eeba7f78fcee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162492
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 1a4a215bc59e50958b2c04ac405c5200f5811970)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162468

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 657d162ff732..9e06dca31dce 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1485,7 +1485,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 }
 }
 
-if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) )
+if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) && SfxViewShell::Current() )
 {
 SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell();
 


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-01-05 Thread Heiko Tietze (via logerrit)
 sfx2/source/dialog/backingwindow.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a19137e28c86b9ff118f3cfdd52554e7c326357c
Author: Heiko Tietze 
AuthorDate: Wed Jan 3 15:48:13 2024 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Jan 5 13:38:22 2024 +0100

Resolves tdf#158810 - Hide recent actions while in template mode

Change-Id: I7291cc7a634a0507bb240bf417d346e7a50f3c6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161587
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit fc03109024041ea00bb62e90975e9a20a3668101)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161635
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sfx2/source/dialog/backingwindow.cxx 
b/sfx2/source/dialog/backingwindow.cxx
index 846fa2ffb70e..9e30572d12d3 100644
--- a/sfx2/source/dialog/backingwindow.cxx
+++ b/sfx2/source/dialog/backingwindow.cxx
@@ -593,7 +593,7 @@ IMPL_LINK( BackingWindow, ToggleHdl, weld::Toggleable&, 
rButton, void )
 mxAllRecentThumbnails->GrabFocus();
 mxRecentButton->set_active(true);
 mxTemplateButton->set_active(false);
-mxActions->set_sensitive(true);
+mxActions->show();
 }
 else
 {
@@ -604,7 +604,7 @@ IMPL_LINK( BackingWindow, ToggleHdl, weld::Toggleable&, 
rButton, void )
 mxLocalView->GrabFocus();
 mxRecentButton->set_active(false);
 mxTemplateButton->set_active(true);
-mxActions->set_sensitive(false);
+mxActions->hide();
 }
 applyFilter();
 }


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-01-05 Thread Justin Luth (via logerrit)
 sfx2/source/appl/sfxpicklist.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit c806266613b5a110caa6a50327d264173d6a17d5
Author: Justin Luth 
AuthorDate: Fri Dec 10 19:01:04 2021 +0200
Commit: Michael Stahl 
CommitDate: Fri Jan 5 13:07:37 2024 +0100

tdf#139636 thumbnail: don't regenerate on file close

Back in 2001, this might have been the primary time
when the thumbnail was generated. Now it is also generated
on file open and file-save. This bug report is at least
one example why regenerating on exit is not desireable.

But are there examples of why a thumbnail IS needed on file exit?

One way the thumbnail can change is viewing track changes,
since toggling track changes doesn't "modify" the document.

What other things can affect the document layout
without be considered a modification?

Change-Id: Ic08fefadb7a2ff594dc2788dfc9cf9e0cc528a71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126649
Reviewed-by: Justin Luth 
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Michael Stahl 
(cherry picked from commit 1f6d845e10737d6ad1fec1c0ff660baae0ce3f3c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161641

diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index cb3b0d5872be..64ebcc1a342c 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -52,14 +52,14 @@ class SfxPickListImpl : public SfxListener
certain requirements, e.g. being writable. Check implementation for 
requirement
details.
  */
-static void AddDocumentToPickList( const SfxObjectShell* pDocShell 
);
+static void AddDocumentToPickList(const SfxObjectShell* pDocShell, bool 
bNoThumbnail = false);
 
 public:
 SfxPickListImpl(SfxApplication& rApp);
 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 };
 
-void SfxPickListImpl::AddDocumentToPickList( const SfxObjectShell* pDocSh )
+void SfxPickListImpl::AddDocumentToPickList(const SfxObjectShell* pDocSh, bool 
bNoThumbnail)
 {
 if (pDocSh->IsAvoidRecentDocs() || comphelper::LibreOfficeKit::isActive())
 return;
@@ -96,7 +96,7 @@ void SfxPickListImpl::AddDocumentToPickList( const 
SfxObjectShell* pDocSh )
 
 // generate the thumbnail
 //fdo#74834: only generate thumbnail for history if the corresponding 
option is not disabled in the configuration
-if (!pDocSh->IsModified() && !Application::IsHeadlessModeEnabled() &&
+if (!bNoThumbnail && !pDocSh->IsModified() && 
!Application::IsHeadlessModeEnabled() &&
 officecfg::Office::Common::History::RecentDocsThumbnail::get())
 {
 // not modified => the document matches what is in the shell
@@ -198,7 +198,8 @@ void SfxPickListImpl::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
 case SfxEventHintId::SaveToDocDone:
 case SfxEventHintId::CloseDoc:
 {
-AddDocumentToPickList(pDocSh);
+const bool bNoThumbnail = rEventHint.GetEventId() == 
SfxEventHintId::CloseDoc;
+AddDocumentToPickList(pDocSh, bNoThumbnail);
 }
 break;
 


core.git: Branch 'libreoffice-24-2' - sfx2/source

2023-12-21 Thread Caolán McNamara (via logerrit)
 sfx2/source/view/viewfrm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit d58baf4aba25999afc16c7c0429963ab7d29eaf4
Author: Caolán McNamara 
AuthorDate: Thu Dec 21 20:20:29 2023 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Dec 21 23:32:39 2023 +0100

cid#1559856 Dereference after null check

we check for a null pOldSh earlier, so logically we need to check
here too, or drop the other null check

Change-Id: I8a9110a9d1ee753f523101862fa62e20760bdb1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161156
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 24bea7e809cd..57fbb91d5d66 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2548,7 +2548,8 @@ bool SfxViewFrame::SwitchToViewShell_Impl
 // save the view data of the old view, so it can be restored later on 
(when needed)
 SaveCurrentViewData_Impl( nViewId );
 
-pOldSh->SetDying();
+if (pOldSh)
+pOldSh->SetDying();
 
 // create and load new ViewShell
 SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(


core.git: Branch 'libreoffice-24-2' - sfx2/source

2023-12-14 Thread Michael Stahl (via logerrit)
 sfx2/source/doc/docfile.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit 0a221dc654062c9bb282ab520e1b7a93d94227e1
Author: Michael Stahl 
AuthorDate: Wed Dec 13 19:49:23 2023 +0100
Commit: Michael Stahl 
CommitDate: Thu Dec 14 09:09:10 2023 +0100

sfx2: remove wrong asserts

Mike Kaganski points out that "soffice -n anything.docx" triggers the
one in GetOutStream(), called from SfxMedium::CreateTempFile()
!bTransferSuccess path, so the assumption of which parts of SfxMedium
can be in use concurrently was wrong.

Change-Id: I40f321d71297cadcdf4bf9ba6f07c4db3d2ac523
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160712
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit df23f570536c939ab4b44125ac8f62a8500e6f7c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160693

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 411c980b6e09..d75e25e530c3 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -677,7 +677,6 @@ bool SfxMedium::IsSkipImages() const
 
 SvStream* SfxMedium::GetInStream()
 {
-//assert(!pImpl->xStorage); // either SvStream or Storage
 if ( pImpl->m_pInStream )
 return pImpl->m_pInStream.get();
 
@@ -748,7 +747,6 @@ void SfxMedium::CloseInStream_Impl(bool bInDestruction)
 
 SvStream* SfxMedium::GetOutStream()
 {
-assert(!pImpl->xStorage); // either SvStream or Storage
 if ( !pImpl->m_pOutStream )
 {
 // Create a temp. file if there is none because we always
@@ -1759,7 +1757,6 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( 
bool bCreateTempFile )
 if ( pImpl->xStorage.is() || pImpl->m_bTriedStorage )
 return pImpl->xStorage;
 
-assert(!pImpl->m_pOutStream /*&& !pImpl->m_pInStream*/); // either 
SvStream or Storage
 uno::Sequence< uno::Any > aArgs( 2 );
 auto pArgs = aArgs.getArray();
 


core.git: Branch 'libreoffice-24-2' - sfx2/source

2023-12-13 Thread Michael Stahl (via logerrit)
 sfx2/source/control/recentdocsviewitem.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 944b5a435c14435841d70f09bc922a6a5c0a741c
Author: Michael Stahl 
AuthorDate: Wed Dec 13 12:55:48 2023 +0100
Commit: Michael Stahl 
CommitDate: Wed Dec 13 20:55:48 2023 +0100

sfx2: reduce warning spam from IsDocEncrypted()

Change-Id: I76b9d550c297db7c6f8d1d9a2739fbe050727faf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160680
Tested-by: Jenkins
Reviewed-by: Michael Stahl 
(cherry picked from commit 152e10996fe9c788daec940bab6fe897097ba992)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160692

diff --git a/sfx2/source/control/recentdocsviewitem.cxx 
b/sfx2/source/control/recentdocsviewitem.cxx
index 369e219e98c5..c114be951cfc 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -65,7 +65,7 @@ bool IsDocEncrypted(const OUString& rURL)
 }
 catch (const uno::Exception&)
 {
-TOOLS_WARN_EXCEPTION("sfx", "caught exception trying to find out if 
doc <"
+TOOLS_INFO_EXCEPTION("sfx", "caught exception trying to find out if 
doc <"
 << rURL << "> is encrypted:");
 }