summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2')
-rwxr-xr-xsfx2/Library_qstart.mk7
-rwxr-xr-xsfx2/Library_sfx.mk9
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx4
-rw-r--r--sfx2/source/dialog/passwd.cxx1
-rw-r--r--sfx2/source/dialog/templdlg.cxx64
-rw-r--r--sfx2/source/doc/docfile.cxx11
-rw-r--r--sfx2/source/doc/objstor.cxx2
-rw-r--r--sfx2/source/doc/oleprops.cxx2
-rw-r--r--sfx2/source/inc/templdgi.hxx16
10 files changed, 85 insertions, 33 deletions
diff --git a/sfx2/Library_qstart.mk b/sfx2/Library_qstart.mk
index 0709f60ba5fa..e46a58163134 100755
--- a/sfx2/Library_qstart.mk
+++ b/sfx2/Library_qstart.mk
@@ -44,6 +44,13 @@ $(eval $(call gb_Library_set_defs,qstart_gtk,\
-DENABLE_QUICKSTART_APPLET \
))
+ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
+$(eval $(call gb_Library_set_defs,qstart_gtk,\
+ $$(DEFS) \
+ -DENABLE_SYSTRAY_GTK \
+))
+endif
+
$(eval $(call gb_Library_set_cflags,qstart_gtk,\
$$(CFLAGS) \
$(filter-out -I%,$(GTK_CFLAGS)) \
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 4d2396bf069c..c9ec52c7ab1f 100755
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -56,6 +56,15 @@ $(eval $(call gb_Library_set_defs,sfx,\
-DSFX2_DLLIMPLEMENTATION \
))
+ifeq ($(ENABLE_SYSTRAY_GTK),TRUE)
+$(eval $(call gb_Library_set_defs,sfx,\
+ $$(DEFS) \
+ -DENABLE_QUICKSTART_APPLET \
+ -DENABLE_SYSTRAY_GTK \
+ -DPLUGIN_NAME=libqstart_gtk$(gb_Library_OOOEXT) \
+))
+endif
+
$(eval $(call gb_Library_add_linked_libs,sfx,\
comphelper \
cppu \
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index abbcc16e388f..71977cdd8808 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -90,7 +90,7 @@ extern "C" { static void SAL_CALL thisModule() {} }
# endif
#endif
-#if defined(UNX) && defined(ENABLE_SYSTRAY_GTK)
+#if defined(UNX) && defined(ENABLE_SYSTRAY_GTK) && !defined(PLUGIN_NAME)
#define PLUGIN_NAME "libqstart_gtkli.so"
#endif
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 533320e64acd..47ff3746be87 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -302,8 +302,12 @@ SfxFilterMatcher::SfxFilterMatcher()
SfxFilterMatcher::~SfxFilterMatcher()
{
if ( !pImpl->aName.getLength() )
+ {
// only the global Matcher owns his ImplData
+ if( pImplArr )
+ pImplArr->Remove( pImpl );
delete pImpl;
+ }
}
void SfxFilterMatcher_Impl::Update()
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 41a5de5650f1..87db172258f2 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -124,6 +124,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ),
maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ),
maMainPwdStr ( ),
+ mnMinLen ( 5 ),
mnExtras ( 0 ),
mbAsciiOnly ( false )
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 21ca852d547e..625674af4c66 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -29,6 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sfx2.hxx"
+#include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
+
#include <vcl/menu.hxx>
#include <svl/intitem.hxx>
#include <svl/stritem.hxx>
@@ -116,6 +119,39 @@ SFX_IMPL_DOCKINGWINDOW(SfxTemplateDialogWrapper, SID_STYLE_DESIGNER)
//-------------------------------------------------------------------------
+class SfxCommonTemplateDialog_Impl::DeletionWatcher : private boost::noncopyable
+{
+ typedef void (DeletionWatcher::* bool_type)();
+
+public:
+ explicit DeletionWatcher(SfxCommonTemplateDialog_Impl& rDialog)
+ : m_pDialog(&rDialog)
+ {
+ m_pDialog->impl_setDeletionWatcher(this);
+ }
+
+ ~DeletionWatcher()
+ {
+ if (m_pDialog)
+ m_pDialog->impl_setDeletionWatcher(0);
+ }
+
+ // Signal that the dialog was deleted
+ void signal()
+ {
+ m_pDialog = 0;
+ }
+
+ // Return true if the dialog was deleted
+ operator bool_type() const
+ {
+ return m_pDialog ? 0 : &DeletionWatcher::signal;
+ }
+
+private:
+ SfxCommonTemplateDialog_Impl* m_pDialog;
+};
+
// Re-direct functions
SfxTemplateDialog::SfxTemplateDialog
@@ -741,7 +777,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
pCurObjShell ( NULL ),
xModuleManager ( ::comphelper::getProcessServiceFactory()->createInstance(
DEFINE_CONST_UNICODE("com.sun.star.frame.ModuleManager") ), UNO_QUERY ),
- pbDeleted ( NULL ),
+ m_pDeletionWatcher ( NULL ),
aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT | WB_QUICK_SEARCH ),
aFilterLb ( pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP ),
@@ -786,7 +822,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Mod
pStyleSheetPool ( NULL ),
pTreeBox ( NULL ),
pCurObjShell ( NULL ),
- pbDeleted ( NULL ),
+ m_pDeletionWatcher ( NULL ),
aFmtLb ( this, SfxResId( BT_VLIST ) ),
aFilterLb ( pW, SfxResId( BT_FLIST ) ),
@@ -959,6 +995,11 @@ void SfxCommonTemplateDialog_Impl::ClearResource()
DELETEZ( m_pStyleFamiliesId );
}
+void SfxCommonTemplateDialog_Impl::impl_setDeletionWatcher(DeletionWatcher* pNewWatcher)
+{
+ m_pDeletionWatcher = pNewWatcher;
+}
+
//-------------------------------------------------------------------------
void SfxCommonTemplateDialog_Impl::Initialize()
@@ -997,11 +1038,8 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
pStyleSheetPool = NULL;
delete pTreeBox;
delete pTimer;
- if ( pbDeleted )
- {
- pbDeleted->bDead = true;
- pbDeleted = NULL;
- }
+ if ( m_pDeletionWatcher )
+ m_pDeletionWatcher->signal();
}
//-------------------------------------------------------------------------
@@ -1695,15 +1733,15 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl(
pItems[ nCount++ ] = 0;
- Deleted aDeleted;
- pbDeleted = &aDeleted;
+ DeletionWatcher aDeleted(*this);
sal_uInt16 nModi = pModifier ? *pModifier : 0;
const SfxPoolItem* pItem = rDispatcher.Execute(
nId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
pItems, nModi );
- // FIXME: Dialog can be destroyed while in Execute() check stack variable for dtor flag!
- if ( !pItem || aDeleted() )
+ // Dialog can be destroyed while in Execute() because started
+ // subdialogs are not modal to it (#i97888#).
+ if ( !pItem || aDeleted )
return sal_False;
if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId )
@@ -1725,10 +1763,6 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl(
}
}
- // Reset destroyed flag otherwise we use the pointer in the dtor
- // where the local stack object is already destroyed. This would
- // overwrite objects on the stack!! See #i100110
- pbDeleted = NULL;
return sal_True;
}
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index e5c575298a87..575e32e22ca5 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3330,11 +3330,12 @@ sal_Bool SfxMedium::SetWritableForUserOnly( const ::rtl::OUString& aURL )
{
sal_uInt64 nAttributes = aFileStatus.getAttributes();
- nAttributes &= ~(Attribute_OwnWrite |
- Attribute_GrpWrite |
- Attribute_OthWrite |
- Attribute_ReadOnly);
- nAttributes |= Attribute_OwnWrite;
+ nAttributes &= ~(osl_File_Attribute_OwnWrite |
+ osl_File_Attribute_GrpWrite |
+ osl_File_Attribute_OthWrite |
+ osl_File_Attribute_ReadOnly);
+ nAttributes |= (osl_File_Attribute_OwnWrite |
+ osl_File_Attribute_OwnRead);
bResult = ( osl::File::setAttributes( aURL, nAttributes ) == ::osl::FileBase::E_None );
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 954df88eb949..76c8cfac2bd6 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2811,7 +2811,7 @@ sal_Bool SfxObjectShell::PreDoSaveAs_Impl
// in "SaveAs" title and password will be cleared ( maybe the new itemset contains new values, otherwise they will be empty )
pMergedParams->ClearItem( SID_PASSWORD );
pMergedParams->ClearItem( SID_DOCINFO_TITLE );
-
+ pMergedParams->ClearItem( SID_ENCRYPTIONDATA );
pMergedParams->ClearItem( SID_INPUTSTREAM );
pMergedParams->ClearItem( SID_STREAM );
pMergedParams->ClearItem( SID_CONTENT );
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx
index 0e6113f94f99..e250687c6fef 100644
--- a/sfx2/source/doc/oleprops.cxx
+++ b/sfx2/source/doc/oleprops.cxx
@@ -1156,7 +1156,7 @@ void SfxOlePropertySet::ImplLoad( SvStream& rStrm )
sal_uInt16 nOsMinor;
sal_uInt16 nOsType;
SvGlobalName aGuid;
- sal_Int32 nSectCount;
+ sal_Int32 nSectCount(0);
rStrm >> nByteOrder >> nVersion >> nOsMinor >> nOsType >> aGuid >> nSectCount;
// read sections
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index c7d4e94d7f19..464a0af94b3d 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -102,18 +102,12 @@ public:
// class SfxCommonTemplateDialog_Impl ------------------------------------
-struct Deleted
-{
- bool bDead;
-
- Deleted() : bDead(false) {}
-
- inline bool operator()() { return bDead; }
-};
-
class SfxCommonTemplateDialog_Impl : public SfxListener
{
private:
+ class DeletionWatcher;
+ friend class DeletionWatcher;
+
class ISfxTemplateCommon_Impl : public ISfxTemplateCommon
{
private:
@@ -129,6 +123,8 @@ private:
void ReadResource();
void ClearResource();
+ void impl_setDeletionWatcher(DeletionWatcher* pNewWatcher);
+
protected:
#define MAX_FAMILIES 5
#define COUNT_BOUND_FUNC 13
@@ -155,7 +151,7 @@ protected:
SfxObjectShell* pCurObjShell;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager >
xModuleManager;
- Deleted* pbDeleted;
+ DeletionWatcher* m_pDeletionWatcher;
SfxActionListBox aFmtLb;
ListBox aFilterLb;