summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-07-27 18:05:46 +0200
committerDaniel Rentz <dr@openoffice.org>2010-07-27 18:05:46 +0200
commitfb7fb796e2a9fc294bfc13cd2b986d347b5ba719 (patch)
treea92b7e27aae5b93ac1103a7076150503bed13e7a /sfx2
parent0ae44da7752001293131a96e30d5466b3b7919f2 (diff)
parent85a4e97dc97a88c59ab0cf8a4d89d9f9413adf9f (diff)
mib17: rebase to OOO330_m2
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/syspathw32.cxx2
-rwxr-xr-xsfx2/source/menu/mnumgr.cxx8
-rw-r--r--sfx2/source/view/frame2.cxx5
-rw-r--r--sfx2/source/view/userinputinterception.cxx14
-rw-r--r--sfx2/source/view/viewimp.hxx2
-rw-r--r--sfx2/source/view/viewprn.cxx9
6 files changed, 31 insertions, 9 deletions
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index 73bd84f5249a..c0a163bed39c 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -74,7 +74,7 @@ typedef unsigned short sal_uInt16;
extern "C" bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize)
{
#ifdef WNT
- return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, pFolder, nSize );
+ return _SHGetSpecialFolderW32( CSIDL_TEMPLATES, reinterpret_cast<LPWSTR>(pFolder), nSize );
#else
(void)pFolder;
(void)nSize;
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index b264a5b47861..bc765b95340c 100755
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -578,6 +578,7 @@ SfxPopupMenuManager* SfxPopupMenuManager::Popup( const ResId& rResId, SfxViewFra
return 0;
}
+
void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFrame, const Point& rPoint, Window* pWindow )
{
PopupMenu *pSVMenu = new PopupMenu( rResId );
@@ -622,6 +623,12 @@ void SfxPopupMenuManager::ExecutePopup( const ResId& rResId, SfxViewFrame* pFram
SfxPopupMenuManager aPop( pSVMenu, pFrame->GetBindings() );
aPop.RemoveDisabledEntries();
aPop.Execute( rPoint, pWindow );
+
+ // #i112646 avoid crash when context menu is closed.
+ // the (manually inserted) sub-menu needs to be destroyed before
+ // aPop gets destroyed.
+ delete pThesSubMenu;
+ pThesSubMenu = 0;
}
delete pThesSubMenu;
@@ -631,3 +638,4 @@ Menu* SfxPopupMenuManager::GetSVMenu()
{
return (Menu*) GetMenu()->GetSVMenu();
}
+
diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx
index d99ad8733e03..d43512ac791d 100644
--- a/sfx2/source/view/frame2.cxx
+++ b/sfx2/source/view/frame2.cxx
@@ -280,10 +280,7 @@ SfxFrame* SfxFrame::Create( SfxObjectShell& rDoc, Window& rWindow, USHORT nViewI
aLoadArgs = aArgs.getPropertyValues();
// load the doc into that frame
- ::rtl::OUString sLoaderURL( rDoc.GetModel()->getURL() );
- if ( sLoaderURL.getLength() == 0 )
- sLoaderURL = rDoc.GetFactory().GetFactoryURL();
-
+ ::rtl::OUString sLoaderURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) );
Reference< XComponentLoader > xLoader( xFrame, UNO_QUERY_THROW );
xLoader->loadComponentFromURL(
sLoaderURL,
diff --git a/sfx2/source/view/userinputinterception.cxx b/sfx2/source/view/userinputinterception.cxx
index e716e604b649..ad910a944e0f 100644
--- a/sfx2/source/view/userinputinterception.cxx
+++ b/sfx2/source/view/userinputinterception.cxx
@@ -216,6 +216,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
@@ -247,6 +254,13 @@ namespace sfx2
if ( e.Context == xHandler )
aIterator.remove();
}
+ catch( const RuntimeException& )
+ {
+ throw;
+ }
+ catch( const Exception& )
+ {
+ }
}
}
break;
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 1c9e219cf180..be20cd2f2a47 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -75,7 +75,7 @@ struct SfxViewShell_Impl
::svt::AcceleratorExecute* pAccExec;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
- vcl::PrinterController* pPrinterController;
+ ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController;
SfxViewShell_Impl();
};
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 227099e7d783..4ed0173be8e1 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -332,7 +332,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
mpObjectShell->EnableSetModified( m_bOrigStatus );
if ( mpViewShell )
- mpViewShell->pImp->pPrinterController = 0;
+ {
+ mpViewShell->pImp->m_pPrinterController.reset();
+ }
}
}
@@ -643,7 +645,7 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
this,
rProps
) );
- pImp->pPrinterController = pController.get();
+ pImp->m_pPrinterController = pController;
SfxObjectShell *pObjShell = GetObjectShell();
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
@@ -661,7 +663,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
Printer* SfxViewShell::GetActivePrinter() const
{
- return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0;
+ return (pImp->m_pPrinterController)
+ ? pImp->m_pPrinterController->getPrinter().get() : 0;
}
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )