ooo-build r12490 - in branches/ooo-build-2-4: . patches/src680
- From: thorstenb svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12490 - in branches/ooo-build-2-4: . patches/src680
- Date: Thu, 8 May 2008 10:52:08 +0100 (BST)
Author: thorstenb
Date: Thu May 8 09:52:07 2008
New Revision: 12490
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12490&view=rev
Log:
* patches/src680/linkwarn-svx-warning-dlg.diff: adds a warning
dialog to svx, to be used when someone tries to insert a linked
graphic
* patches/src680/linkwarn-dlg-in-apps.diff: fires up the link
warning dialog in sd, sc, and sw
* patches/src680/linkwarn-sfx2-disable-cb-persistency.diff:
disables persistence of the "link graphics" checkbox state in the
filepicker
* patches/src680/linkwarn-svtools-miscopts-bits.diff: adds config
item to SvtMiscOptions, such that users can disable the link
warning nag box
* patches/src680/linkwarn-officecfg-disable-msgbox.diff: adds
config item to deactivate the link warning msg box to
configuration
* patches/src680/apply: added aforementioned patches to the common
section
Added:
branches/ooo-build-2-4/patches/src680/linkwarn-dlg-in-apps.diff
branches/ooo-build-2-4/patches/src680/linkwarn-officecfg-disable-msgbox.diff
branches/ooo-build-2-4/patches/src680/linkwarn-sfx2-disable-cb-persistency.diff
branches/ooo-build-2-4/patches/src680/linkwarn-svtools-miscopts-bits.diff
branches/ooo-build-2-4/patches/src680/linkwarn-svx-warning-dlg.diff
Modified:
branches/ooo-build-2-4/ChangeLog
branches/ooo-build-2-4/patches/src680/apply
Modified: branches/ooo-build-2-4/patches/src680/apply
==============================================================================
--- branches/ooo-build-2-4/patches/src680/apply (original)
+++ branches/ooo-build-2-4/patches/src680/apply Thu May 8 09:52:07 2008
@@ -51,7 +51,7 @@
SUSE-10.1 : NovellBase, BerkeleyDB43
SUSE-10.2 : NovellBase, BerkeleyDB43, EMFPlus
SUSE-10.3 : NovellBase, BerkeleyDB43, EMFPlus
-SUSE : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, TransparentPrinting, PptExport
+SUSE : NovellBase, BerkeleyDB43, Gcc43, EMFPlus, TransparentPrinting, PptExport, LinkWarningDlg
SUSE-reduced:NovellBase,BerkeleyDB43, ReducedDefaults
# Debian
DebianBase : LinuxCommon, DebianBaseOnly, Lockdown, GCCSTL, CalcSolver, BerkeleyDB43, Split, PostgreSQL
@@ -2296,6 +2296,13 @@
sd-slideshow-slideshowview-transformation-fix.diff, rodo
cairocanvas-fix-image-cache.diff, rodo
+[ LinkWarningDlg ]
+linkwarn-dlg-in-apps.diff, n#348149, thorsten
+linkwarn-sfx2-disable-cb-persistency.diff, n#348149, thorsten
+linkwarn-svtools-miscopts-bits.diff, n#348149, thorsten
+linkwarn-officecfg-disable-msgbox.diff, n#348149, thorsten
+linkwarn-svx-warning-dlg.diff, n#348149, thorsten
+
[ InternalMesaHeaders ]
internal-mesa-headers-config_office.diff, fridrich
internal-mesa-headers-slideshow.diff, fridrich
Added: branches/ooo-build-2-4/patches/src680/linkwarn-dlg-in-apps.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4/patches/src680/linkwarn-dlg-in-apps.diff Thu May 8 09:52:07 2008
@@ -0,0 +1,92 @@
+--- sw/source/ui/uiview/view2.cxx 2008-04-10 23:49:38.000000000 +0200
++++ sw/source/ui/uiview/view2.cxx 2008-05-07 18:39:44.000000000 +0200
+@@ -104,6 +104,7 @@
+ #ifndef SVTOOLS_URIHELPER_HXX
+ #include <svtools/urihelper.hxx>
+ #endif
++#include <svtools/miscopt.hxx>
+ #ifndef _SFX_PASSWD_HXX
+ #include <sfx2/passwd.hxx>
+ #endif
+@@ -119,6 +120,7 @@
+ #ifndef _SVX_LANGITEM_HXX //autogen
+ #include <svx/langitem.hxx>
+ #endif
++#include <svx/linkwarn.hxx>
+ #ifndef _SVX_HTMLMODE_HXX
+ #include <svx/htmlmode.hxx>
+ #endif
+@@ -608,6 +610,14 @@
+ rReq.AppendItem( SfxStringItem( FN_PARAM_2, sGraphicFormat ) );
+ rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bAsLink ) );
+ }
++
++ // really store as link only?
++ if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
++ {
++ SvxLinkWarningDialog aWarnDlg(GetWindow(),pFileDlg->GetPath());
++ if( aWarnDlg.Execute() != RET_OK )
++ bAsLink=sal_False; // don't store as link
++ }
+ }
+
+ SwWrtShell& rSh = GetWrtShell();
+--- sc/source/ui/drawfunc/fuins1.cxx 2008-04-11 00:23:00.000000000 +0200
++++ sc/source/ui/drawfunc/fuins1.cxx 2008-05-07 18:40:07.000000000 +0200
+@@ -42,8 +42,10 @@
+ #include <svx/svdpage.hxx>
+ #include <svx/svdpagv.hxx>
+ #include <svx/svdview.hxx>
++#include <svx/linkwarn.hxx>
+ #include <svtools/filter.hxx>
+ #include <svtools/stritem.hxx>
++#include <svtools/miscopt.hxx>
+ #include <vcl/msgbox.hxx>
+ #include <tools/urlobj.hxx>
+ #include <avmedia/mediawindow.hxx>
+@@ -297,6 +299,14 @@
+ String aFilterName = aDlg.GetCurrentFilter();
+ BOOL bAsLink = aDlg.IsAsLink();
+
++ // really store as link only?
++ if( bAsLink && SvtMiscOptions().ShowLinkWarningDialog() )
++ {
++ SvxLinkWarningDialog aWarnDlg(pWin,aFileName);
++ if( aWarnDlg.Execute() != RET_OK )
++ bAsLink = sal_False; // don't store as link
++ }
++
+ lcl_InsertGraphic( aGraphic, aFileName, aFilterName, bAsLink, FALSE, pViewSh, pWindow, pView );
+
+ // append items for recording
+--- sd/source/ui/func/fuinsert.cxx 2008-04-10 22:20:15.000000000 +0200
++++ sd/source/ui/func/fuinsert.cxx 2008-05-07 18:13:46.000000000 +0200
+@@ -51,9 +51,11 @@
+ #include <sfx2/request.hxx>
+ #include <svtools/globalnameitem.hxx>
+ #include <svtools/pathoptions.hxx>
++#include <svtools/miscopt.hxx>
+ #include <svx/pfiledlg.hxx>
+ #include <svx/impgrf.hxx>
+ #include <svx/dialogs.hrc>
++#include <svx/linkwarn.hxx>
+ #include <svx/linkmgr.hxx>
+ #include <svx/svdetc.hxx>
+ #include <avmedia/mediawindow.hxx>
+@@ -178,7 +180,15 @@
+
+ if(pGrafObj && aDlg.IsAsLink())
+ {
+- // store link only?
++ // really store as link only?
++ if( SvtMiscOptions().ShowLinkWarningDialog() )
++ {
++ SvxLinkWarningDialog aWarnDlg(mpWindow,aDlg.GetPath());
++ if( aWarnDlg.Execute() != RET_OK )
++ return; // don't store as link
++ }
++
++ // store as link
+ String aFltName(aDlg.GetCurrentFilter());
+ String aPath(aDlg.GetPath());
+ pGrafObj->SetGraphicLink(aPath, aFltName);
Added: branches/ooo-build-2-4/patches/src680/linkwarn-officecfg-disable-msgbox.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4/patches/src680/linkwarn-officecfg-disable-msgbox.diff Thu May 8 09:52:07 2008
@@ -0,0 +1,18 @@
+--- officecfg/registry/schema/org/openoffice/Office/Common.xcs 2008-05-08 07:04:27.000000000 +0200
++++ officecfg/registry/schema/org/openoffice/Office/Common.xcs 2008-05-07 10:32:49.000000000 +0200
+@@ -5456,6 +5456,15 @@
+ </info>
+ <value>true</value>
+ </prop>
++ <prop oor:name="ShowLinkWarningDialog" oor:type="xs:boolean">
++ <info>
++ <author>THB</author>
++ <desc>Determines if a warning dialog should be
++ displayed when a user checks the link checkbox in
++ the insert graphics dialog.</desc>
++ </info>
++ <value>true</value>
++ </prop>
+ <prop oor:name="DisableUICustomization" oor:type="xs:boolean">
+ <info>
+ <author>RSiddhartha</author>
Added: branches/ooo-build-2-4/patches/src680/linkwarn-sfx2-disable-cb-persistency.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4/patches/src680/linkwarn-sfx2-disable-cb-persistency.diff Thu May 8 09:52:07 2008
@@ -0,0 +1,29 @@
+--- sfx2/source/dialog/filedlghelper.cxx 2008-04-15 16:18:43.000000000 +0200
++++ sfx2/source/dialog/filedlghelper.cxx 2008-05-08 08:03:49.000000000 +0200
+@@ -1960,11 +1960,7 @@
+
+ try
+ {
+- aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 );
+ sal_Bool bValue = sal_False;
+- aValue >>= bValue;
+- aUserData.SetToken( 0, ' ', String::CreateFromInt32( (sal_Int32) bValue ) );
+-
+ aValue = xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 );
+ bValue = sal_False;
+ aValue >>= bValue;
+@@ -2089,14 +2085,6 @@
+ {
+ try
+ {
+- // respect the last "insert as link" state
+- sal_Bool bLink = (sal_Bool) aUserData.GetToken( 0, ' ' ).ToInt32();
+- if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0 ).hasValue() )
+- {
+- aValue <<= bLink;
+- xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0, aValue );
+- }
+-
+ // respect the last "show preview" state
+ sal_Bool bShowPreview = (sal_Bool) aUserData.GetToken( 1, ' ' ).ToInt32();
+ if ( !xDlg->getValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0 ).hasValue() )
Added: branches/ooo-build-2-4/patches/src680/linkwarn-svtools-miscopts-bits.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4/patches/src680/linkwarn-svtools-miscopts-bits.diff Thu May 8 09:52:07 2008
@@ -0,0 +1,139 @@
+--- svtools/inc/svtools/miscopt.hxx.orig 2008-05-08 08:58:57.000000000 +0200
++++ svtools/inc/svtools/miscopt.hxx 2008-05-08 09:12:01.000000000 +0200
+@@ -160,6 +160,11 @@
+ sal_Bool IsModifyByPrinting() const;
+ void SetModifyByPrinting(sal_Bool bSet );
+
++ sal_Bool ShowLinkWarningDialog() const;
++ void SetShowLinkWarningDialog( sal_Bool bSet );
++ sal_Bool IsShowLinkWarningDialogReadOnly() const;
++
++
+ //-------------------------------------------------------------------------------------------------------------
+ // private methods
+ //-------------------------------------------------------------------------------------------------------------
+--- svtools/source/config/miscopt.cxx.orig 2008-05-08 08:58:57.000000000 +0200
++++ svtools/source/config/miscopt.cxx 2008-05-08 09:27:56.000000000 +0200
+@@ -114,8 +114,10 @@
+ #define PROPERTYHANDLE_SYMBOLSTYLE 4
+ #define PROPERTYNAME_DISABLEUICUSTOMIZATION ASCII_STR("DisableUICustomization")
+ #define PROPERTYHANDLE_DISABLEUICUSTOMIZATION 5
++#define PROPERTYNAME_SHOWLINKWARNINGDIALOG ASCII_STR("ShowLinkWarningDialog")
++#define PROPERTYHANDLE_SHOWLINKWARNINGDIALOG 6
+
+-#define PROPERTYCOUNT 6
++#define PROPERTYCOUNT 7
+
+ #define VCL_TOOLBOX_STYLE_FLAT ((USHORT)0x0004) // from <vcl/toolbox.hxx>
+
+@@ -143,6 +145,8 @@
+ sal_Int16 m_nToolboxStyle;
+ sal_Bool m_bIsToolboxStyleRO;
+ sal_Bool m_bDisableUICustomization;
++ sal_Bool m_bShowLinkWarningDialog;
++ sal_Bool m_bIsShowLinkWarningDialogRO;
+
+ //-------------------------------------------------------------------------------------------------------------
+ // public methods
+@@ -253,6 +257,15 @@
+ inline sal_Bool IsGetToolboxStyleReadOnly()
+ { return m_bIsToolboxStyleRO; }
+
++ inline sal_Bool ShowLinkWarningDialog() const
++ { return m_bShowLinkWarningDialog; }
++
++ void SetShowLinkWarningDialog( sal_Bool bSet )
++ { m_bShowLinkWarningDialog = bSet; SetModified(); }
++
++ sal_Bool IsShowLinkWarningDialogReadOnly() const
++ { return m_bIsShowLinkWarningDialogRO; }
++
+ void AddListener( const Link& rLink );
+ void RemoveListener( const Link& rLink );
+ void CallListeners();
+@@ -332,6 +345,8 @@
+ , m_bIsSymbolsStyleRO( sal_False )
+ , m_nToolboxStyle( 1 )
+ , m_bIsToolboxStyleRO( sal_False )
++ , m_bShowLinkWarningDialog( sal_True )
++ , m_bIsShowLinkWarningDialogRO( sal_False )
+
+ {
+ // Use our static list of configuration keys to get his values.
+@@ -405,6 +420,16 @@
+ break;
+ }
+
++ case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG :
++ {
++ if( !(seqValues[nProperty] >>= m_bShowLinkWarningDialog) )
++ {
++ DBG_ERROR("Wrong type of \"Misc\\ShowLinkWarningDialog\"!" );
++ }
++ m_bIsShowLinkWarningDialogRO = seqRO[nProperty];
++ break;
++ }
++
+ case PROPERTYHANDLE_DISABLEUICUSTOMIZATION :
+ {
+ if( !(seqValues[nProperty] >>= m_bDisableUICustomization) )
+@@ -495,6 +520,13 @@
+ }
+ }
+ break;
++ case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG : {
++ if( !(seqValues[nProperty] >>= m_bShowLinkWarningDialog) )
++ {
++ DBG_ERROR("Wrong type of \"Misc\\ShowLinkWarningDialog\"!" );
++ }
++ }
++ break;
+ case PROPERTYHANDLE_SYMBOLSTYLE : {
+ ::rtl::OUString aSymbolsStyle;
+ if( seqValues[nProperty] >>= aSymbolsStyle )
+@@ -656,6 +688,13 @@
+ seqValues[nProperty] <<= m_bDisableUICustomization;
+ break;
+ }
++
++ case PROPERTYHANDLE_SHOWLINKWARNINGDIALOG :
++ {
++ if ( !m_bIsShowLinkWarningDialogRO )
++ seqValues[nProperty] <<= m_bShowLinkWarningDialog;
++ break;
++ }
+ }
+ }
+ // Set properties in configuration.
+@@ -675,7 +714,8 @@
+ PROPERTYNAME_TOOLBOXSTYLE,
+ PROPERTYNAME_USESYSTEMFILEDIALOG,
+ PROPERTYNAME_SYMBOLSTYLE,
+- PROPERTYNAME_DISABLEUICUSTOMIZATION
++ PROPERTYNAME_DISABLEUICUSTOMIZATION,
++ PROPERTYNAME_SHOWLINKWARNINGDIALOG
+ };
+
+ // Initialize return sequence with these list ...
+@@ -841,6 +881,21 @@
+ return m_pDataContainer->IsGetToolboxStyleReadOnly();
+ }
+
++sal_Bool SvtMiscOptions::ShowLinkWarningDialog() const
++{
++ return m_pDataContainer->ShowLinkWarningDialog();
++}
++
++void SvtMiscOptions::SetShowLinkWarningDialog( sal_Bool bSet )
++{
++ m_pDataContainer->SetShowLinkWarningDialog( bSet );
++}
++
++sal_Bool SvtMiscOptions::IsShowLinkWarningDialogReadOnly() const
++{
++ return m_pDataContainer->IsShowLinkWarningDialogReadOnly();
++}
++
+ //*****************************************************************************************************************
+ // private method
+ //*****************************************************************************************************************
Added: branches/ooo-build-2-4/patches/src680/linkwarn-svx-warning-dlg.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-2-4/patches/src680/linkwarn-svx-warning-dlg.diff Thu May 8 09:52:07 2008
@@ -0,0 +1,448 @@
+--- svx/inc/svx/dialogs.hrc 2008-05-08 07:03:42.000000000 +0200
++++ svx/inc/svx/dialogs.hrc 2008-05-07 14:19:21.000000000 +0200
+@@ -38,7 +38,7 @@
+ // Resource-Id's ------------------------------------------------------------
+
+ // Bitte FIRSTFREE pflegen!!! (gilt nicht f"ur Strings)
+-#define RID_SVX_FIRSTFREE 302
++#define RID_SVX_FIRSTFREE 312
+
+ // ResId fuer die Hintergrund-TabPage
+ #define RID_SVXPAGE_BACKGROUND (RID_SVX_START + 1)
+@@ -437,6 +437,7 @@
+ #define RID_OPTPAGE_CHART_DEFCOLORS (RID_SVX_START + 299)
+ #define RID_SVXDLG_SECURITY_OPTIONS (RID_SVX_START + 300)
+ #define RID_SVXDLG_WEBCONNECTION_INFO (RID_SVX_START + 301)
++#define RID_SVXDLG_LINK_WARNING (RID_SVX_START + 311)
+ // !!! please update RID_SVX_FIRSTFREE !!! see line 46
+
+ // Strings ------------------------------------------------------------------
+diff -urN ooo-build-anon/build/current/svx/inc/svx/linkwarn.hxx ooo-build/build/current/svx/inc/svx/linkwarn.hxx
+--- svx/inc/svx/linkwarn.hxx 1970-01-01 01:00:00.000000000 +0100
++++ svx/inc/svx/linkwarn.hxx 2008-05-07 18:08:58.000000000 +0200
+@@ -0,0 +1,61 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: linkwarn.hxx,v $
++ *
++ * $Revision: $
++ *
++ * last change: $Author: $ $Date: $
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library 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 for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++#ifndef _SFX_LINKWARN_HXX
++#define _SFX_LINKWARN_HXX
++
++#include <vcl/button.hxx>
++#include <vcl/fixed.hxx>
++#include <sfx2/basedlgs.hxx>
++#include "svx/svxdllapi.h"
++
++class SVX_DLLPUBLIC SvxLinkWarningDialog : public SfxModalDialog
++{
++private:
++ FixedImage m_aQueryImage;
++ FixedText m_aInfoText;
++ OKButton m_aLinkGraphicBtn;
++ CancelButton m_aEmbedGraphicBtn;
++ FixedLine m_aOptionLine;
++ CheckBox m_aWarningOnBox;
++
++ void InitSize();
++
++public:
++ SvxLinkWarningDialog( Window* pParent, const String& _rFileName );
++ virtual ~SvxLinkWarningDialog();
++};
++
++#endif // #ifndef _SFX_LINKWARN_HXX
++
+diff -urN ooo-build-anon/build/current/svx/prj/d.lst ooo-build/build/current/svx/prj/d.lst
+--- svx/prj/d.lst 2008-05-08 07:04:17.000000000 +0200
++++ svx/prj/d.lst 2008-05-07 15:27:21.000000000 +0200
+@@ -53,6 +53,7 @@
+ ..\inc\charhiddenitem.hxx %_DEST%\inc%_EXT%\svx\charhiddenitem.hxx
+ ..\inc\svx\bmpmask.hxx %_DEST%\inc%_EXT%\svx\bmpmask.hxx
+ ..\inc\bolnitem.hxx %_DEST%\inc%_EXT%\svx\bolnitem.hxx
++..\inc\svx\linkwarn.hxx %_DEST%\inc%_EXT%\svx\linkwarn.hxx
+ ..\inc\svx\borderline.hxx %_DEST%\inc%_EXT%\svx\borderline.hxx
+ ..\inc\svx\boxitem.hxx %_DEST%\inc%_EXT%\svx\boxitem.hxx
+ ..\inc\svx\brkitem.hxx %_DEST%\inc%_EXT%\svx\brkitem.hxx
+--- svx/source/dialog/linkwarn.cxx 1970-01-01 01:00:00.000000000 +0100
++++ svx/source/dialog/linkwarn.cxx 2008-05-07 18:12:55.000000000 +0200
+@@ -0,0 +1,155 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: linkwarn.cxx,v $
++ *
++ * $Revision: $
++ *
++ * last change: $Author: $ $Date: $
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library 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 for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_svx.hxx"
++
++#include "linkwarn.hrc"
++#include "svx/linkwarn.hxx"
++#include "svx/dialogs.hrc"
++#include "svx/dialmgr.hxx"
++#include <vcl/msgbox.hxx>
++#include <sfx2/basedlgs.hxx>
++#include <svtools/miscopt.hxx>
++
++SvxLinkWarningDialog::SvxLinkWarningDialog( Window* pParent, const String& _rFileName ) :
++ SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_LINK_WARNING ) ),
++ m_aQueryImage ( this, SVX_RES( FI_QUERY ) ),
++ m_aInfoText ( this, SVX_RES( FT_INFOTEXT ) ),
++ m_aLinkGraphicBtn ( this, SVX_RES( PB_OK ) ),
++ m_aEmbedGraphicBtn ( this, SVX_RES( PB_NO ) ),
++ m_aOptionLine ( this, SVX_RES( FL_OPTION ) ),
++ m_aWarningOnBox ( this, SVX_RES( CB_WARNING_OFF ) )
++{
++ FreeResource();
++
++ // set questionmark image
++ m_aQueryImage.SetImage( QueryBox::GetStandardImage() );
++
++ // replace filename
++ String sInfoText = m_aInfoText.GetText();
++ sInfoText.SearchAndReplaceAll(
++ UniString::CreateFromAscii(
++ RTL_CONSTASCII_STRINGPARAM( "%FILENAME" ) ), _rFileName );
++ m_aInfoText.SetText( sInfoText );
++
++ // load state of "warning on" checkbox from misc options
++ SvtMiscOptions aMiscOpt;
++ m_aWarningOnBox.Check( aMiscOpt.ShowLinkWarningDialog() == sal_True );
++ if( aMiscOpt.IsShowLinkWarningDialogReadOnly() )
++ m_aWarningOnBox.Disable();
++
++ // set focus to Cancel button
++ m_aEmbedGraphicBtn.GrabFocus();
++
++ // calculate and set the size of the dialog and its controls
++ InitSize();
++}
++
++// -----------------------------------------------------------------------
++
++SvxLinkWarningDialog::~SvxLinkWarningDialog()
++{
++ // save value of "warning off" checkbox, if necessary
++ SvtMiscOptions aMiscOpt;
++ sal_Bool bChecked = m_aWarningOnBox.IsChecked();
++ if ( aMiscOpt.ShowLinkWarningDialog() != bChecked )
++ aMiscOpt.SetShowLinkWarningDialog( bChecked );
++}
++
++// -----------------------------------------------------------------------
++
++void SvxLinkWarningDialog::InitSize()
++{
++ // text of checkbox to wide -> add new line
++ long nTxtW = m_aWarningOnBox.GetCtrlTextWidth( m_aWarningOnBox.GetText() ) + IMPL_EXTRA_BUTTON_WIDTH;
++ long nCtrlW = m_aWarningOnBox.GetSizePixel().Width();
++ if ( nTxtW >= nCtrlW )
++ {
++ long nTextHeight = m_aWarningOnBox.GetTextHeight();
++ Size aNewSize = m_aWarningOnBox.GetSizePixel();
++ aNewSize.Height() += nTextHeight;
++ m_aWarningOnBox.SetSizePixel( aNewSize );
++ aNewSize = GetSizePixel();
++ aNewSize.Height() += nTextHeight;
++ SetSizePixel( aNewSize );
++ }
++
++ // align the size of the information text control (FixedText) to its content
++ Size aMinSize = m_aInfoText.CalcMinimumSize( m_aInfoText.GetSizePixel().Width() );
++ long nTxtH = aMinSize.Height();
++ long nCtrlH = m_aInfoText.GetSizePixel().Height();
++ long nDelta = ( nCtrlH - nTxtH );
++ Size aNewSize = m_aInfoText.GetSizePixel();
++ aNewSize.Height() -= nDelta;
++ m_aInfoText.SetSizePixel( aNewSize );
++
++ // new position for the succeeding windows
++ Window* pWins[] =
++ {
++ &m_aLinkGraphicBtn, &m_aEmbedGraphicBtn, &m_aOptionLine, &m_aWarningOnBox
++ };
++ Window** pCurrent = pWins;
++ for ( sal_uInt32 i = 0; i < sizeof(pWins) / sizeof(*pWins); ++i, ++pCurrent )
++ {
++ Point aNewPos = (*pCurrent)->GetPosPixel();
++ aNewPos.Y() -= nDelta;
++ (*pCurrent)->SetPosPixel( aNewPos );
++ }
++
++ // new size of the dialog
++ aNewSize = GetSizePixel();
++ aNewSize.Height() -= nDelta;
++ SetSizePixel( aNewSize );
++
++ // recalculate the size and position of the buttons
++ nTxtW = m_aLinkGraphicBtn.GetCtrlTextWidth( m_aLinkGraphicBtn.GetText() );
++ long nTemp = m_aEmbedGraphicBtn.GetCtrlTextWidth( m_aEmbedGraphicBtn.GetText() );
++ if ( nTemp > nTxtW )
++ nTxtW = nTemp;
++ nTxtW += IMPL_EXTRA_BUTTON_WIDTH;
++ Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
++ Point aPos = m_aLinkGraphicBtn.GetPosPixel();
++ aPos.X() = ( aNewSize.Width() - (2*nTxtW) - a3Size.Width() ) / 2;
++ long nDefX = m_aWarningOnBox.GetPosPixel().X();
++ if ( nDefX < aPos.X() )
++ aPos.X() = nDefX;
++ aNewSize = m_aLinkGraphicBtn.GetSizePixel();
++ aNewSize.Width() = nTxtW;
++ m_aLinkGraphicBtn.SetPosSizePixel( aPos, aNewSize );
++ aPos.X() += nTxtW + a3Size.Width();
++ m_aEmbedGraphicBtn.SetPosSizePixel( aPos, aNewSize );
++}
++
+diff -urN ooo-build-anon/build/current/svx/source/dialog/linkwarn.hrc ooo-build/build/current/svx/source/dialog/linkwarn.hrc
+--- svx/source/dialog/linkwarn.hrc 1970-01-01 01:00:00.000000000 +0100
++++ svx/source/dialog/linkwarn.hrc 2008-05-07 17:21:30.000000000 +0200
+@@ -0,0 +1,67 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: linkwarn.hrc,v $
++ *
++ * $Revision: $
++ *
++ * last change: $Author: $ $Date: $
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library 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 for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++#ifndef _SVX_LINKWARN_HRC
++#define _SVX_LINKWARN_HRC
++
++#include <svtools/controldims.hrc>
++
++// dialog ids
++#define FI_QUERY 10
++#define FT_INFOTEXT 11
++#define PB_OK 12
++#define PB_NO 13
++#define FL_OPTION 15
++#define CB_WARNING_OFF 16
++
++// --------- general metrics ---------
++
++#define SYMBOL_EDGE 20
++#define DIALOG_WIDTH 220
++#define INFO_TEXT_LINES 11
++
++#define AW_COL_1 (RSC_SP_DLG_INNERBORDER_LEFT)
++#define AW_COL_2 (AW_COL_1+SYMBOL_EDGE+RSC_SP_CTRL_DESC_X)
++#define AW_COL_3 (AW_COL_2+RSC_CD_PUSHBUTTON_WIDTH+RSC_SP_CTRL_DESC_X)
++#define AW_COL_4 (DIALOG_WIDTH-RSC_SP_DLG_INNERBORDER_RIGHT-RSC_CD_PUSHBUTTON_WIDTH)
++
++#define AW_ROW_1 (RSC_SP_DLG_INNERBORDER_TOP)
++#define AW_ROW_2 (AW_ROW_1+INFO_TEXT_LINES*RSC_CD_FIXEDTEXT_HEIGHT+RSC_SP_CTRL_Y)
++#define AW_ROW_3 (AW_ROW_2+RSC_CD_PUSHBUTTON_HEIGHT+RSC_SP_CTRL_DESC_Y)
++#define AW_ROW_4 (AW_ROW_3+RSC_CD_FIXEDLINE_HEIGHT+RSC_SP_CTRL_DESC_Y)
++
++#define DIALOG_HEIGHT (AW_ROW_4+RSC_CD_CHECKBOX_HEIGHT+RSC_SP_DLG_INNERBORDER_BOTTOM)
++
++#endif
++
+diff -urN ooo-build-anon/build/current/svx/source/dialog/linkwarn.src ooo-build/build/current/svx/source/dialog/linkwarn.src
+--- svx/source/dialog/linkwarn.src 1970-01-01 01:00:00.000000000 +0100
++++ svx/source/dialog/linkwarn.src 2008-05-07 20:13:42.000000000 +0200
+@@ -0,0 +1,94 @@
++/*************************************************************************
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: linkwarn.src,v $
++ *
++ * $Revision: $
++ *
++ * last change: $Author: $ $Date: $
++ *
++ * The Contents of this file are made available subject to
++ * the terms of GNU Lesser General Public License Version 2.1.
++ *
++ *
++ * GNU Lesser General Public License Version 2.1
++ * =============================================
++ * Copyright 2005 by Sun Microsystems, Inc.
++ * 901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License version 2.1, as published by the Free Software Foundation.
++ *
++ * This library 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 for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ ************************************************************************/
++
++#include "linkwarn.hrc"
++#include "svx/dialogs.hrc"
++#include "helpid.hrc"
++
++ModalDialog RID_SVXDLG_LINK_WARNING
++{
++ Size = MAP_APPFONT( DIALOG_WIDTH, DIALOG_HEIGHT );
++ OutputSize = TRUE;
++ Closeable = FALSE;
++ Moveable = TRUE;
++ SVLook = TRUE;
++
++ Text = "%PRODUCTNAME %PRODUCTVERSION %PRODUCTEXTENSION";
++
++ FixedImage FI_QUERY
++ {
++ Pos = MAP_APPFONT( AW_COL_1, AW_ROW_1 );
++ Size = MAP_APPFONT( SYMBOL_EDGE, SYMBOL_EDGE );
++ };
++ FixedText FT_INFOTEXT
++ {
++ Pos = MAP_APPFONT( AW_COL_2, AW_ROW_1 );
++ Size = MAP_APPFONT( DIALOG_WIDTH-AW_COL_2-RSC_SP_DLG_INNERBORDER_RIGHT, INFO_TEXT_LINES*RSC_CD_FIXEDTEXT_HEIGHT );
++ NoLabel = TRUE;
++ Wordbreak = TRUE;
++ Text [ en-US ] = "The file %FILENAME will not be stored along with your document, but only referenced as a link. This is dangerous if you move and/or rename the files. Do you want to embed the graphic instead?";
++ Text [ de-DE ] = "Die Datei %FILENAME wird nicht zusammen mit dem Dokument gespeichert, sondern nur als Verweis referenziert. Dies kann zu Problemen fÃhren, wenn die Dateien verschoben und/oder umbenannt werden. MÃchten Sie stattdessen die Grafik als eingebettetes Objekt einfÃgen?";
++ };
++ OKButton PB_OK
++ {
++ Pos = MAP_APPFONT( AW_COL_2, AW_ROW_2 );
++ Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
++ DefButton = TRUE ;
++ Text [ en-US ] = "~Keep Link";
++ Text [ de-DE ] = "~Als Verweis einfÃgen";
++ };
++ CancelButton PB_NO
++ {
++ Pos = MAP_APPFONT( AW_COL_3, AW_ROW_2 );
++ Size = MAP_APPFONT( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT );
++ Text [ en-US ] = "~Embed Graphic";
++ Text [ de-DE ] = "~Eingebettet einfÃgen";
++ };
++ FixedLine FL_OPTION
++ {
++ Pos = MAP_APPFONT( 0, AW_ROW_3 );
++ Size = MAP_APPFONT( DIALOG_WIDTH, RSC_CD_FIXEDLINE_HEIGHT );
++ };
++ CheckBox CB_WARNING_OFF
++ {
++ Pos = MAP_APPFONT( AW_COL_2, AW_ROW_4 );
++ Size = MAP_APPFONT( DIALOG_WIDTH-AW_COL_2-RSC_SP_DLG_INNERBORDER_RIGHT, RSC_CD_CHECKBOX_HEIGHT );
++ WordBreak = TRUE ;
++ Text [ en-US ] = "~Ask when linking a graphic";
++ Text [ de-DE ] = "~Nachfragen falls Grafik als Verweis eingefÃgt wird";
++ };
++};
++
++
+--- svx/source/dialog/makefile.mk 2008-05-08 07:03:59.000000000 +0200
++++ svx/source/dialog/makefile.mk 2008-05-07 17:19:22.000000000 +0200
+@@ -83,6 +83,7 @@
+ impgrf.src \
+ language.src \
+ lingu.src \
++ linkwarn.src \
+ numfmt.src \
+ numpages.src \
+ page.src \
+@@ -191,6 +192,7 @@
+ $(SLO)$/hldoctp.obj \
+ $(SLO)$/imapdlg.obj \
+ $(SLO)$/imapwnd.obj \
++ $(SLO)$/linkwarn.obj \
+ $(SLO)$/measure.obj \
+ $(SLO)$/dstribut.obj \
+ $(SLO)$/measctrl.obj \
+@@ -336,6 +338,7 @@
+ $(SLO)$/hdft.obj \
+ $(SLO)$/impgrf.obj \
+ $(SLO)$/langbox.obj \
++ $(SLO)$/linkwarn.obj \
+ $(SLO)$/wrapfield.obj \
+ $(SLO)$/pagectrl.obj \
+ $(SLO)$/paraprev.obj \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]