summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/doc.hrc6
-rw-r--r--sfx2/source/doc/doc.src15
-rw-r--r--sfx2/source/doc/makefile.mk5
-rw-r--r--sfx2/source/doc/objcont.cxx5
-rw-r--r--sfx2/source/doc/querytemplate.cxx55
-rw-r--r--sfx2/source/doc/querytemplate.hxx47
6 files changed, 129 insertions, 4 deletions
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
index b17a11b40f24..ae4ff419565c 100644
--- a/sfx2/source/doc/doc.hrc
+++ b/sfx2/source/doc/doc.hrc
@@ -211,8 +211,12 @@
#define MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN (RID_SFX_DOC_START+125)
#define STR_XMLSEC_ODF12_EXPECTED (RID_SFX_DOC_START+126)
+#define STR_QRYTEMPL_MESSAGE (RID_SFX_DOC_START+127)
+#define STR_QRYTEMPL_UPDATE_BTN (RID_SFX_DOC_START+128)
+#define STR_QRYTEMPL_KEEP_BTN (RID_SFX_DOC_START+129)
+
// please update to the last id
-#define ACT_SFX_DOC_END STR_XMLSEC_ODF12_EXPECTED
+#define ACT_SFX_DOC_END STR_QRYTEMPL_KEEP_BTN
#if ACT_SFX_DOC_END > RID_SFX_DOC_END
#error resource overflow in #line, #file
#endif
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
index 1d10290cb167..3f8ab1ae7177 100644
--- a/sfx2/source/doc/doc.src
+++ b/sfx2/source/doc/doc.src
@@ -520,5 +520,20 @@ QueryBox MSG_XMLSEC_QUERY_SAVESIGNEDBEFORESIGN
Message [ en-US ] = "The document has to be saved before it can be signed. Saving the document removes all present signatures.\nDo you want to save the document?";
};
+String STR_QRYTEMPL_MESSAGE
+{
+ Text [ en-US ] = "The template '$(ARG1)' on which this document is based, has been modified. Do you want to update style based formattings according to the modified template?";
+};
+
+String STR_QRYTEMPL_UPDATE_BTN
+{
+ Text [ en-US ] = "~Update Styles";
+};
+
+String STR_QRYTEMPL_KEEP_BTN
+{
+ Text [ en-US ] = "~Keep Old Styles";
+};
+
// ******************************************************************* EOF
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
index c2398fdd74bf..b46ee5aa30e8 100644
--- a/sfx2/source/doc/makefile.mk
+++ b/sfx2/source/doc/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -81,7 +81,8 @@ SLOFILES = \
$(SLO)$/docmacromode.obj \
$(SLO)$/SfxDocumentMetaData.obj \
$(SLO)$/sfxmodelfactory.obj \
- $(SLO)$/docstoragemodifylistener.obj
+ $(SLO)$/docstoragemodifylistener.obj \
+ $(SLO)$/querytemplate.obj
# --- Tagets -------------------------------------------------------
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index df77e397bf81..b7c2791cde32 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -84,6 +84,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/request.hxx>
#include "openflag.hxx"
+#include "querytemplate.hxx"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -1320,7 +1321,9 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
bLoad = TRUE;
else if ( bCanUpdateFromTemplate == document::UpdateDocMode::ACCORDING_TO_CONFIG )
{
- QueryBox aBox( GetDialogParent(), SfxResId(MSG_QUERY_LOAD_TEMPLATE) );
+ String sMessage( SfxResId( STR_QRYTEMPL_MESSAGE ) );
+ sMessage.SearchAndReplace( String::CreateFromAscii("$(ARG1)"), aTemplName );
+ sfx2::QueryTemplateBox aBox( GetDialogParent(), sMessage );
if ( RET_YES == aBox.Execute() )
bLoad = TRUE;
}
diff --git a/sfx2/source/doc/querytemplate.cxx b/sfx2/source/doc/querytemplate.cxx
new file mode 100644
index 000000000000..d430205a831e
--- /dev/null
+++ b/sfx2/source/doc/querytemplate.cxx
@@ -0,0 +1,55 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: openlocked.cxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sfx2.hxx"
+
+#include "querytemplate.hxx"
+#include "sfxresid.hxx"
+#include "doc.hrc"
+
+#include <vcl/svapp.hxx>
+
+namespace sfx2
+{
+
+QueryTemplateBox::QueryTemplateBox( Window* pParent, const String& rMessage ) :
+ MessBox ( pParent, 0, Application::GetDisplayName(), rMessage )
+{
+ SetImage( QueryBox::GetStandardImage() );
+ SetHelpId( MSG_QUERY_LOAD_TEMPLATE );
+
+ AddButton( String( SfxResId( STR_QRYTEMPL_UPDATE_BTN ) ), RET_YES,
+ BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_OKBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ AddButton( String( SfxResId( STR_QRYTEMPL_KEEP_BTN ) ), RET_NO, BUTTONDIALOG_CANCELBUTTON );
+}
+
+} // end of namespace sfx2
+
diff --git a/sfx2/source/doc/querytemplate.hxx b/sfx2/source/doc/querytemplate.hxx
new file mode 100644
index 000000000000..71f709db06dd
--- /dev/null
+++ b/sfx2/source/doc/querytemplate.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: openlocked.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SFX2_QUERYTEMPLATE_HXX
+#define _SFX2_QUERYTEMPLATE_HXX
+
+#include <vcl/msgbox.hxx>
+
+namespace sfx2
+{
+
+ class QueryTemplateBox : public MessBox
+ {
+ public:
+ QueryTemplateBox( Window* pParent, const String& rMessage );
+ };
+
+} // end of namespace sfx2
+
+#endif
+