summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/docsh.hxx9
-rw-r--r--sw/source/ui/app/docsh2.cxx287
-rw-r--r--sw/source/ui/chrdlg/chardlg.cxx146
-rw-r--r--sw/source/ui/dialog/makefile.mk7
-rw-r--r--sw/source/ui/envelp/mailmrge.cxx35
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx85
-rw-r--r--sw/source/ui/inc/frmpage.hxx8
-rw-r--r--sw/source/ui/inc/textsh.hxx11
-rw-r--r--sw/source/ui/index/cnttab.cxx61
-rw-r--r--sw/source/ui/misc/glossary.cxx46
-rw-r--r--sw/source/ui/misc/makefile.mk13
-rw-r--r--sw/source/ui/shells/grfsh.cxx293
-rw-r--r--sw/source/ui/shells/textsh.cxx9
13 files changed, 375 insertions, 635 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 6af3c30e7105..a92782700402 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsh.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: mib $ $Date: 2001-04-12 12:55:02 $
+ * last change: $Author: os $ $Date: 2001-05-15 09:58:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,7 +92,6 @@ class Reader;
class SwReader;
class SwCrsrShell;
class SwSrcView;
-class SfxFileDialog;
class PushButton;
class FixedText;
class SwPaM;
@@ -142,9 +141,6 @@ class SwDocShell: public SfxObjectShell, public SfxInPlaceObject,
//
virtual SfxDocumentInfoDialog* CreateDocumentInfoDialog(
Window *pParent, const SfxItemSet &);
- // Template-Btn
- Window* AddTemplateBtn(SfxFileDialog* pFileDlg);
-
// OLE-Geraffel
virtual void Draw( OutputDevice*, const JobSetup&, USHORT);
@@ -170,7 +166,6 @@ class SwDocShell: public SfxObjectShell, public SfxInPlaceObject,
void RemoveOLEObjects();
DECL_STATIC_LINK( SwDocShell, IsLoadFinished, void* );
- DECL_LINK( SelTemplateHdl, PushButton * );
public:
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 24b79b62f138..b88379306cc7 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: docsh2.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: jp $ $Date: 2001-05-08 16:29:35 $
+ * last change: $Author: os $ $Date: 2001-05-15 09:59:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -119,8 +119,8 @@
#ifndef _SFXNEW_HXX //autogen
#include <sfx2/new.hxx>
#endif
-#ifndef _IODLG_HXX
-#include <sfx2/iodlg.hxx>
+#ifndef _FILEDLGHELPER_HXX
+#include <sfx2/filedlghelper.hxx>
#endif
#ifndef _SFX_PRINTER_HXX //autogen
#include <sfx2/printer.hxx>
@@ -229,9 +229,6 @@
#ifndef _PAGEDESC_HXX
#include <pagedesc.hxx>
#endif
-#ifndef _LTMPDLG_HXX
-#include <ltmpdlg.hxx>
-#endif
#ifndef _SHELLIO_HXX
#include <shellio.hxx>
#endif
@@ -284,7 +281,25 @@
#ifndef _GLOBALS_HRC
#include <globals.hrc>
#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILTERMANAGER_HPP_
+#include <com/sun/star/ui/XFilterManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKERCONTROLACCESS_HPP_
+#include <com/sun/star/ui/XFilePickerControlAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_FILEPICKERELEMENTID_HPP_
+#include <com/sun/star/ui/FilePickerElementID.hpp>
+#endif
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ui;
using namespace ::com::sun::star;
using namespace ::rtl;
@@ -832,44 +847,73 @@ void SwDocShell::Execute(SfxRequest& rReq)
BOOL bNumbering = FALSE;
USHORT nRet = USHRT_MAX;
SvtPathOptions aPathOpt;
- SwLoadTemplateDlg* pDlg = new SwLoadTemplateDlg(0);
- pDlg->SetPath( aPathOpt.GetWorkPath() );
+// SwLoadTemplateDlg* pDlg = new SwLoadTemplateDlg(0);
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
+ {
+ Sequence <Any> aProps(1);
+ DBG_ERROR("appropriate service not yet available!")
+// should be something like
+// aProps.getArray()[0] <<= C2U("FileOpen_TemplateBoxes");
+ aProps.getArray()[0] <<= C2U("FileOpen");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
+ }
+ xFP->setDisplayDirectory( aPathOpt.GetWorkPath() );
SfxObjectFactory &rFact = GetFactory();
+ Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
for( USHORT i = 0; i < rFact.GetFilterCount(); i++ )
{
const SfxFilter* pFlt = rFact.GetFilter( i );
if( pFlt && pFlt->IsAllowedAsTemplate() )
- pDlg->AddFilter( pFlt->GetUIName(),
- ((WildCard&)pFlt->GetWildcard())(),
- pFlt->GetTypeName() );
+ {
+ const String sWild = ((WildCard&)pFlt->GetWildcard()).GetWildCard();
+ xFltMgr->appendFilter( pFlt->GetUIName(), sWild );
+ }
if( pFlt->GetUserData().EqualsAscii( FILTER_XML ))
- pDlg->SetCurFilter( pFlt->GetUIName() );
+ xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ;
+
}
- nRet = pDlg->Execute();
+ nRet = xFP->execute();
if( nRet == RET_OK )
{
- aFileName = pDlg->GetPath();
+ aFileName = xFP->getPath().getConstArray()[0];
}
- else if( nRet == RET_TEMPLATE )
- {
- SfxNewFileDialog* pNewDlg = pDlg->GetNewFileDlg();
+// else if( nRet == RET_TEMPLATE )
+// {
+// SfxNewFileDialog* pNewDlg = pDlg->GetNewFileDlg();
- nRet = pNewDlg->Execute();
- if( nRet == RET_OK )
- aFileName = pNewDlg->GetTemplateFileName();
- }
+// nRet = pNewDlg->Execute();
+// if( nRet == RET_OK )
+// aFileName = pNewDlg->GetTemplateFileName();
+// }
SwgReaderOption aOpt;
- aOpt.SetFrmFmts( pDlg->IsFrameStyle() );
- aOpt.SetTxtFmts( pDlg->IsTextStyle() );
- aOpt.SetPageDescs( pDlg->IsPageStyle() );
- aOpt.SetNumRules( pDlg->IsNumbering() );
- aOpt.SetMerge( !pDlg->IsOverwrite() );
+ try
+ {
+ Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY);
+ Any aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_TEXT);
+ aOpt.SetTxtFmts( aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True);
+ aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_FRAME);
+ aOpt.SetFrmFmts( aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True );
+ aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_PAGES);
+ aOpt.SetPageDescs( aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True );
+ aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_NUMBERING);
+ aOpt.SetNumRules( aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True );
+ aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_OVERWRITE);
+ aOpt.SetMerge( !(aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True) );
+ }
+ catch(Exception& rEx)
+ {
+ DBG_ERROR("control acces failed")
+ }
- delete pDlg;
if( aFileName.Len() )
SetError( LoadStylesFromFile( aFileName, aOpt, FALSE ));
}
@@ -1154,8 +1198,18 @@ void SwDocShell::Execute(SfxRequest& rReq)
const SwTxtFmtColl* pSplitColl = 0;
- SfxFileDialog* pFileDlg =
- new SfxFileDialog( 0, WB_SAVEAS|WB_SVLOOK );
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
+ {
+ Sequence <Any> aProps(1);
+ aProps.getArray()[0] <<= C2U("FileSave_AutoextTemplateBox");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
+ }
+
const SfxFilter* pFlt;
USHORT nStrId;
@@ -1179,30 +1233,66 @@ void SwDocShell::Execute(SfxRequest& rReq)
if( pFlt )
{
- pFileDlg->AddFilter( pFlt->GetUIName(),
- ((WildCard&)pFlt->GetWildcard())(),
- pFlt->GetTypeName() );
+ Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
+ const String sWild = ((WildCard&)pFlt->GetWildcard()).GetWildCard();
+ xFltMgr->appendFilter( pFlt->GetUIName(), sWild );
+ xFltMgr->setCurrentFilter( pFlt->GetUIName() ) ;
+ }
- pFileDlg->SetCurFilter( pFlt->GetUIName() );
+ Reference<XFilePickerControlAccess> xCtrlAcc(xFP, UNO_QUERY);
+ const USHORT nCount = pWrtShell->GetTxtFmtCollCount();
+ Sequence<OUString> aListBoxEntries(nCount);
+ OUString* pEntries = aListBoxEntries.getArray();
+ sal_Int32 nIdx = 0;
+ sal_Int32 nSelect = 0;
+ OUString sStartTemplate;
+ for(USHORT i = 0; i < nCount; ++i)
+ {
+ SwTxtFmtColl &rTxtColl = pWrtShell->GetTxtFmtColl(i);
+ if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() )
+ {
+ if(!sStartTemplate.getLength())
+ {
+ SwTxtFmtColl *pFnd = 0, *pAny = 0;
+ if( MAXLEVEL >= rTxtColl.GetOutlineLevel() && ( !pFnd ||
+ pFnd->GetOutlineLevel() > rTxtColl.GetOutlineLevel() ))
+ pFnd = &rTxtColl;
+ else if( !pAny )
+ pAny = &rTxtColl;
+ sStartTemplate = pFnd ? pFnd->GetName() : pAny ? pAny->GetName() : OUString();
+ nSelect = nIdx;
+ }
+ pEntries[nIdx++] = rTxtColl.GetName();
+ }
}
+ aListBoxEntries.realloc(nIdx);
- SvtPathOptions aPathOpt;
- Window *pTemplateFT = AddTemplateBtn(pFileDlg);
- pFileDlg->SetText( SW_RESSTR( nStrId ));
- pFileDlg->SetPath( aPathOpt.GetWorkPath() );
+ try
+ {
+ Any aTemplates(&aListBoxEntries, ::getCppuType(&aListBoxEntries));
+ xCtrlAcc->setValue( FilePickerElementID::CBO_TEMPLATES, aTemplates );
+ Any aSelectPos(&nSelect, ::getCppuType(&nSelect));
+ xCtrlAcc->setValue( FilePickerElementID::CBO_TEMPLATES, aSelectPos );
+ xCtrlAcc->setLabel( FilePickerElementID::CBO_TEMPLATES,
+ String(SW_RES( STR_FDLG_TEMPLATE_NAME )));
+ }
+ catch(Exception& rEx)
+ {
+ DBG_ERROR("control acces failed")
+ }
- if( RET_OK == pFileDlg->Execute() )
+ xFP->setTitle( SW_RESSTR( nStrId ));
+ SvtPathOptions aPathOpt;
+ xFP->setDisplayDirectory( aPathOpt.GetWorkPath() );
+ if( RET_OK == xFP->execute() )
{
- aFileName = pFileDlg->GetPath();
- sTemplateName = pTemplateFT->GetText();
- sTemplateName.Erase(0, String(SW_RESSTR(STR_FDLG_TEMPLATE_NAME)).Len());
+ aFileName = xFP->getPath().getConstArray()[0];
+ Any aTemplateValue = xCtrlAcc->getValue( FilePickerElementID::CBO_TEMPLATES );
if (sTemplateName.Len())
pSplitColl = pDoc->FindTxtFmtCollByName(sTemplateName);
}
- delete pFileDlg;
-
if( aFileName.Len() )
{
if( PrepareClose( FALSE ) &&
@@ -1532,64 +1622,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
pDoc->ResetModified();
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-Window *SwDocShell::AddTemplateBtn(SfxFileDialog* pFileDlg)
-{
- PushButton *pTemplateBtn = new PushButton( pFileDlg );
- pTemplateBtn->SetText( SW_RESSTR(STR_FDLG_TEMPLATE_BUTTON) );
- pTemplateBtn->SetClickHdl(LINK(this, SwDocShell, SelTemplateHdl));
- pTemplateBtn->SetHelpId(HID_SELECT_TEMPLATE);
-#if (SUPD>503)
- pFileDlg->AddControl( pTemplateBtn, TRUE );
-#else
- pFileDlg->AddControl( pTemplateBtn );
-#endif
- pTemplateBtn->Show();
-
- FixedText *pTemplateFT = new FixedText( pFileDlg );
-
- String sName( SW_RES( STR_FDLG_TEMPLATE_NAME ));
- sName += SwSelTemplateDlg::GetStartTemplate( *pWrtShell );
- pTemplateFT->SetText(sName);
-
- pFileDlg->AddControl( pTemplateFT );
- pTemplateFT->SetSizePixel(Size(pTemplateFT->LogicToPixel(Size(160, 1), MAP_APPFONT).Width(), pTemplateFT->GetSizePixel().Height()));
- pTemplateFT->Show();
-
- pTemplateBtn->SetData(pTemplateFT); // Verweis auf den Template-Namen
-
- // Die hinzugefuegten Controls werden spaeter vom FileDlg geloescht
- return pTemplateFT;
-}
-
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-IMPL_LINK( SwDocShell, SelTemplateHdl, PushButton *, pBtn )
-{
- if (pWrtShell)
- {
- FixedText *pFT = (FixedText*)pBtn->GetData();
- String sFixName(SW_RES(STR_FDLG_TEMPLATE_NAME));
-
- String sName(pFT->GetText());
- sName.Erase(0, sFixName.Len());
-
- SwSelTemplateDlg aDlg( pBtn, pWrtShell, sName);
-
- if( aDlg.Execute() == RET_OK )
- {
- sFixName += sName;
- pFT->SetText(sFixName);
- }
- }
-
- return 0;
-}
/* -----------------------------14.12.99 16:52--------------------------------
---------------------------------------------------------------------------*/
@@ -1707,57 +1739,6 @@ ULONG SwDocShell::LoadStylesFromFile( const String& rURL,
return nErr;
}
-/*------------------------------------------------------------------------
- $Log: not supported by cvs2svn $
- Revision 1.16 2001/03/08 21:21:16 jp
- change: old data transfer API to the new
-
- Revision 1.15 2001/02/26 07:56:31 mib
- xml filters for templates and global docs
-
- Revision 1.14 2001/02/09 13:17:15 mib
- FillClass corrected
-
- Revision 1.13 2001/02/06 15:41:26 mib
- real 6.0 file format
-
- Revision 1.12 2001/02/05 18:44:42 jp
- Bug #83467#: LoadStylesFrom - initialise the reader variable
-
- Revision 1.11 2001/02/01 14:30:13 mib
- XML files now can be loaded/saved as own format
-
- Revision 1.10 2001/01/15 18:47:06 jp
- use TempFile::GetURL instead of ::GetFileName
-
- Revision 1.9 2000/11/06 09:21:17 jp
- must changes: tempfile
-
- Revision 1.8 2000/11/01 10:13:28 jp
- new method LoadStyleFromFile for docshell and uno
-
- Revision 1.7 2000/10/31 20:32:32 jp
- change usage of filestream to medium
-
- Revision 1.6 2000/10/26 11:23:10 jp
- Bug #75694#: use replace instead close & open
-
- Revision 1.5 2000/10/23 18:12:37 jp
- ToggleBrowserMode without GPF
-
- Revision 1.4 2000/10/19 13:16:35 jp
- DocSh:Execute: call DoClose after the new load is call
-
- Revision 1.3 2000/10/06 13:31:28 jp
- should changes: don't use IniManager
-
- Revision 1.2 2000/09/26 13:33:18 jp
- SFXDISPATHER removed
-
- Revision 1.1.1.1 2000/09/18 17:14:31 hr
- initial import
-
-------------------------------------------------------------------------*/
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 914f65b239c2..14e0b32c99ec 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: chardlg.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: os $ $Date: 2001-04-18 09:08:24 $
+ * last change: $Author: os $ $Date: 2001-05-15 09:59:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,9 +78,6 @@
#ifndef _SFXSTRITEM_HXX
#include <svtools/stritem.hxx>
#endif
-#ifndef _IODLG_HXX
-#include <sfx2/iodlg.hxx>
-#endif
#ifndef _SVX_CHARDLG_HXX //autogen
#include <svx/chardlg.hxx>
#endif
@@ -146,8 +143,18 @@
#ifndef _CHARDLG_HRC
#include <chardlg.hrc>
#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ui;
+#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
/*--------------------------------------------------------------------
Beschreibung: Der Traeger des Dialoges
--------------------------------------------------------------------*/
@@ -409,16 +416,23 @@ SfxTabPage* SwCharURLPage::Create( Window* pParent,
IMPL_LINK( SwCharURLPage, InsertFileHdl, PushButton *, pBtn )
{
- SfxFileDialog* pFileDlg = new SfxFileDialog(pBtn, WB_OPEN);
- pFileDlg->DisableSaveLastDirectory();
- pFileDlg->SetHelpId(HID_FILEDLG_CHARDLG);
-
- if(RET_OK == pFileDlg->Execute())
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
{
- aURLED.SetText(URIHelper::SmartRelToAbs(pFileDlg->GetPath()));
+ Sequence <Any> aProps(1);
+ aProps.getArray()[0] <<= C2U("FileOpen");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
+ }
+ DBG_ERROR("how to set help ids at com.sun.star.ui.FilePicker")
+// pFileDlg->SetHelpId(HID_FILEDLG_CHARDLG);
+ if( xFP->execute() == RET_OK )
+ {
+ aURLED.SetText(URIHelper::SmartRelToAbs(xFP->getPath().getConstArray()[0]));
}
- delete pFileDlg;
-
return 0;
}
/*-----------------14.08.96 15.00-------------------
@@ -432,110 +446,4 @@ IMPL_LINK( SwCharURLPage, EventHdl, PushButton *, EMPTYARG )
return 0;
}
-/*------------------------------------------------------------------------
-
- $Log: not supported by cvs2svn $
- Revision 1.4 2000/11/27 10:02:09 jp
- Task #80425#: remove tabpage two lines if drawobject selected
-
- Revision 1.3 2000/11/27 08:58:45 jp
- Task #80425#: new tabpages
-
- Revision 1.2 2000/10/20 13:46:39 jp
- use correct INetURL-Decode enum
-
- Revision 1.1.1.1 2000/09/18 17:14:32 hr
- initial import
-
- Revision 1.213 2000/09/18 16:05:13 willem.vandorp
- OpenOffice header added.
-
- Revision 1.212 2000/08/31 11:37:50 jp
- add missing include
-
- Revision 1.211 2000/08/17 13:48:23 jp
- UI with decode URL
-
- Revision 1.210 2000/07/26 16:32:19 jp
- use the new function GetDocPoolNm to get the collectionames
-
- Revision 1.209 2000/07/03 10:33:17 os
- #72742# resource warnings corrected
-
- Revision 1.208 2000/06/26 13:06:44 os
- INetURLObject::SmartRelToAbs removed
-
- Revision 1.207 2000/04/19 12:56:33 os
- include sfx2/filedlg.hxx removed
-
- Revision 1.206 2000/02/11 14:43:26 hr
- #70473# changes for unicode ( patched by automated patchtool )
-
- Revision 1.205 2000/01/24 12:53:41 os
- #72153# call SfxFileDialog::DisableSaveLastDirectory
-
- Revision 1.204 1999/02/19 07:48:02 MA
- #61949# CurrShell gibt es nicht mehr
-
-
- Rev 1.203 19 Feb 1999 08:48:02 MA
- #61949# CurrShell gibt es nicht mehr
-
- Rev 1.202 12 Feb 1999 07:35:36 OS
- #61800# Keine URL und kein Hintergrund fuer DrawText
-
- Rev 1.201 02 Sep 1998 14:11:10 OM
- #45378# HelpIDs fuer Dateidialoge
-
- Rev 1.200 09 Jul 1998 08:57:10 OS
- vor dem putten in jedem Fall Listbox-Inhalte auswerten #52425#
-
- Rev 1.199 29 Jun 1998 09:39:30 OS
- kein Blinken fuer DrawText#48019#
-
- Rev 1.198 15 Apr 1998 14:33:06 OS
- ::FillCharStyleListBox
-
- Rev 1.197 28 Nov 1997 15:01:48 MA
- includes
-
- Rev 1.196 01 Sep 1997 13:25:14 OS
- DLL-Umstellung
-
- Rev 1.195 15 Aug 1997 12:12:36 OS
- chartar/frmatr/txtatr aufgeteilt
-
- Rev 1.194 09 Aug 1997 13:01:46 OS
- paraitem/frmitems/textitem aufgeteilt
-
- Rev 1.193 08 Aug 1997 17:29:44 OM
- Headerfile-Umstellung
-
- Rev 1.192 18 Jun 1997 17:30:02 OS
- URL wird jetzt mit SfxFileDialog gesucht #40815#
-
- Rev 1.191 21 Apr 1997 16:27:00 OS
- TargetFrame jetzt in ComboBox
-
- Rev 1.190 08 Apr 1997 09:22:40 MA
- chg: falsche Definition entfernt
-
- Rev 1.189 07 Apr 1997 14:15:08 MH
- chg: header
-
- Rev 1.188 20 Mar 1997 16:58:20 OS
- Leerstring: URL zuruecksetzen
-
- Rev 1.187 10 Mar 1997 17:28:48 OS
- URL-Edit per GetSavedValue auf Modifikation testen
-
- Rev 1.186 14 Feb 1997 18:04:06 OM
- Zahlenformat-Dlg
-
- Rev 1.185 05 Feb 1997 13:31:32 OS
- keine Zeichenvorlagen fuer Hyperlinks im HTML
-
-
-------------------------------------------------------------------------*/
-
diff --git a/sw/source/ui/dialog/makefile.mk b/sw/source/ui/dialog/makefile.mk
index 6695b08cdf04..0bb6eacddec6 100644
--- a/sw/source/ui/dialog/makefile.mk
+++ b/sw/source/ui/dialog/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: obo $ $Date: 2001-02-20 10:26:04 $
+# last change: $Author: os $ $Date: 2001-05-15 10:00:33 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -86,7 +86,6 @@ CXXFILES = \
abstract.cxx \
ascfldlg.cxx \
docstdlg.cxx \
- ltmpdlg.cxx \
macassgn.cxx \
regionsw.cxx
@@ -95,7 +94,6 @@ SRCFILES = \
ascfldlg.src \
dialog.src \
docstdlg.src \
- ltmpdlg.src \
regionsw.src
SLOFILES = \
@@ -103,7 +101,6 @@ SLOFILES = \
$(SLO)$/addrdlg.obj \
$(SLO)$/ascfldlg.obj \
$(SLO)$/docstdlg.obj \
- $(SLO)$/ltmpdlg.obj \
$(SLO)$/macassgn.obj \
$(SLO)$/regionsw.obj
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 17ea01efc67d..2887a44bfea2 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mailmrge.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: os $ $Date: 2001-05-09 08:15:09 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:02:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -137,6 +137,9 @@
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
#endif
+#ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
+#include <com/sun/star/ui/XFolderPicker.hpp>
+#endif
using namespace rtl;
using namespace com::sun::star::container;
@@ -147,7 +150,7 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::util;
using namespace com::sun::star::uno;
using namespace com::sun::star::frame;
-
+using namespace ::com::sun::star::ui;
#define C2S(cChar) UniString::CreateFromAscii(cChar)
#define C2U(cChar) OUString::createFromAscii(cChar)
@@ -622,17 +625,23 @@ IMPL_LINK( SwMailMergeDlg, InsertPathHdl, PushButton *, pBtn )
SvtPathOptions aPathOpt;
sPath = aPathOpt.GetWorkPath();
}
- WinBits nBits = WB_3DLOOK|WB_STDMODAL|WB_OPEN|SFXWB_PATHDIALOG;
-
- SfxFileDialog* pFileDlg = new SfxFileDialog( this, nBits );
- pFileDlg->DisableSaveLastDirectory();
- pFileDlg->SetPath( sPath );
- pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE1);
-
- if (pFileDlg->Execute())
- aPathED.SetText(pFileDlg->GetPath());
- delete pFileDlg;
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFolderPicker > xFP;
+ if( xMgr.is() )
+ {
+ xFP = Reference< XFolderPicker >(
+ xMgr->createInstance(
+ C2U( "com.sun.star.ui.FolderPicker" ) ),
+ UNO_QUERY );
+ }
+ DBG_ERROR("how to set help ids at com.sun.star.ui.FolderPicker")
+// pFileDlg->SetHelpId(HID_FILEDLG_MAILMRGE1);
+ xFP->setDisplayDirectory(sPath);
+ if( xFP->execute() == RET_OK )
+ {
+ aPathED.SetText(xFP->getDisplayDirectory());
+ }
return 0;
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 10c5ae15480f..a2e811c82427 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmpage.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: os $ $Date: 2001-03-15 10:44:53 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:02:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,9 +87,6 @@
#ifndef _SFXSTRITEM_HXX //autogen
#include <svtools/stritem.hxx>
#endif
-#ifndef _IODLG_HXX
-#include <sfx2/iodlg.hxx>
-#endif
#ifndef _SVX_IMPGRF_HXX //autogen
#include <svx/impgrf.hxx>
#endif
@@ -176,6 +173,30 @@
#ifndef _GLOBALS_HRC
#include <globals.hrc>
#endif
+#ifndef _FILEDLGHELPER_HXX
+#include <sfx2/filedlghelper.hxx>
+#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKERCONTROLACCESS_HPP_
+#include <com/sun/star/ui/XFilePickerControlAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_FILEPICKERELEMENTID_HPP_
+#include <com/sun/star/ui/FilePickerElementID.hpp>
+#endif
+
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ui;
+using namespace ::com::sun::star;
+using namespace ::rtl;
+using namespace ::sfx2;
+
+#define C2U(cChar) rtl::OUString::createFromAscii(cChar)
struct FrmMap
{
@@ -2293,13 +2314,20 @@ int SwGrfExtPage::DeactivatePage(SfxItemSet *pSet)
IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
{
if(!pGrfDlg)
- pGrfDlg = new SvxImportGraphicDialog( this,
- SW_RESSTR(STR_EDIT_GRF), ENABLE_STANDARD );
- pGrfDlg->SetPath( aConnectED.GetText(), FALSE, TRUE );
+ {
+ pGrfDlg = new FileDialogHelper( SFXWB_GRAPHIC );
+ pGrfDlg->SetTitle(SW_RESSTR(STR_EDIT_GRF ));
+ }
+ pGrfDlg->SetDisplayDirectory( aConnectED.GetText() );
+ Reference < XFilePicker > xFP = pGrfDlg->GetFilePicker();
+ Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
+ sal_Bool bTrue = sal_True;
+ Any aVal(&bTrue, ::getBooleanCppuType());
+ xCtrlAcc->setValue( FilePickerElementID::CBX_INSERT_AS_LINK, aVal);
- if ( pGrfDlg->Execute() == RET_OK )
+ if ( pGrfDlg->Execute() == ERRCODE_NONE )
{ // ausgewaehlten Filter merken
- aFilterName = pGrfDlg->GetCurFilter();
+ aFilterName = pGrfDlg->GetCurrentFilter();
aNewGrfName = INetURLObject::decode( pGrfDlg->GetPath(),
INET_HEX_ESCAPE,
INetURLObject::DECODE_UNAMBIGUOUS,
@@ -2316,16 +2344,13 @@ IMPL_LINK( SwGrfExtPage, BrowseHdl, Button *, EMPTYARG )
aRightPagesRB.Enable(FALSE);
aBmpWin.MirrorHorz(FALSE);
aBmpWin.MirrorVert(FALSE);
- BOOL bEnable = FALSE;
- Graphic* pGrf = pGrfDlg->GetGraphic();
- if(pGrf)
- {
- aBmpWin.SetGraphic(*pGrf);
- if( GRAPHIC_BITMAP == pGrf->GetType() ||
- GRAPHIC_GDIMETAFILE == pGrf->GetType())
- bEnable = TRUE;
- }
+ Graphic aGraphic;
+ ::LoadGraphic( pGrfDlg->GetPath(), aEmptyStr, aGraphic );
+ aBmpWin.SetGraphic(aGraphic);
+
+ BOOL bEnable = GRAPHIC_BITMAP == aGraphic.GetType() ||
+ GRAPHIC_GDIMETAFILE == aGraphic.GetType();
aMirrorVertBox.Enable(bEnable);
aMirrorHorzBox.Enable(bEnable);
aAllPagesRB .Enable(bEnable);
@@ -2560,20 +2585,26 @@ SfxTabPage* SwFrmURLPage::Create(Window *pParent, const SfxItemSet &rSet)
IMPL_LINK( SwFrmURLPage, InsertFileHdl, PushButton *, pBtn )
{
- SfxFileDialog* pFileDlg = new SfxFileDialog(pBtn, WB_OPEN);
- pFileDlg->DisableSaveLastDirectory();
- pFileDlg->SetHelpId(HID_FILEDLG_CHARDLG);
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
+ {
+ Sequence <Any> aProps(1);
+ aProps.getArray()[0] <<= C2U("FileOpen");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
+ }
String sTemp(aURLED.GetText());
if(sTemp.Len())
- pFileDlg->SetPath(sTemp);
-
- if(RET_OK == pFileDlg->Execute())
+ xFP->setDisplayDirectory(sTemp);
+ if( xFP->execute() == RET_OK )
{
- aURLED.SetText( URIHelper::SmartRelToAbs( pFileDlg->GetPath(), FALSE,
+ aURLED.SetText( URIHelper::SmartRelToAbs( xFP->getPath().getConstArray()[0], FALSE,
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_UNAMBIGUOUS));
}
- delete pFileDlg;
return 0;
}
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index c37c4168d90e..8deb555def55 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: frmpage.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: os $ $Date: 2001-02-09 07:58:34 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:02:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,7 +94,7 @@
#include <prcntfld.hxx>
#endif
-class SvxImportGraphicDialog;
+namespace sfx2{class FileDialogHelper;}
class SwWrtShell;
struct FrmMap;
@@ -230,7 +230,7 @@ class SwGrfExtPage: public SfxTabPage
String aFilterName;
String aGrfName, aNewGrfName;
- SvxImportGraphicDialog* pGrfDlg;
+ ::sfx2::FileDialogHelper* pGrfDlg;
BOOL bHtmlMode;
diff --git a/sw/source/ui/inc/textsh.hxx b/sw/source/ui/inc/textsh.hxx
index 5089657fdc03..40d303e5bce9 100644
--- a/sw/source/ui/inc/textsh.hxx
+++ b/sw/source/ui/inc/textsh.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textsh.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jp $ $Date: 2000-12-21 13:01:37 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:02:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -74,11 +74,6 @@ class SwTextShell: public SwBaseShell
{
SwFldMgr* pPostItFldMgr;
- // Itemset pointer for the Graphic-Insert Dialog. This set contains all
- // graphic sepcifict attributes and will only be created / deletec by the
- // methods InsertGraphicDialog and InitGraphicFrame
- SfxItemSet* pInsGrfSetPtr;
-
void InsertSymbol( const String& rChars, const String& rFont );
void InsertHyperlink(const SvxHyperlinkItem& rHlnkItem);
BOOL InsertGraphicDlg();
@@ -94,8 +89,6 @@ public:
DECL_LINK( RedlineNextHdl, Button * );
DECL_LINK( RedlinePrevHdl, Button * );
- DECL_LINK( InitGraphicFrame, Button * );
-
void Execute(SfxRequest &);
void GetState(SfxItemSet &);
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 10518a6d6ef1..f1043a77ac1a 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: cnttab.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: os $ $Date: 2001-02-26 14:06:21 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:02:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -94,9 +94,6 @@
#ifndef _SFXDOCFILE_HXX
#include <sfx2/docfile.hxx>
#endif
-#ifndef _IODLG_HXX
-#include <sfx2/iodlg.hxx>
-#endif
#ifndef _SVX_BACKGRND_HXX //autogen
#include <svx/backgrnd.hxx>
#endif
@@ -145,6 +142,15 @@
#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#endif
+#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
+#include <comphelper/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILTERMANAGER_HPP_
+#include <com/sun/star/ui/XFilterManager.hpp>
+#endif
#ifndef _UCBHELPER_CONTENT_HXX
#include <ucbhelper/content.hxx>
#endif
@@ -247,7 +253,10 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ui;
using namespace ::rtl;
#define C2S(cChar) UniString::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(cChar))
@@ -288,34 +297,40 @@ String lcl_CreateAutoMarkFileDlg( Window* pParent, const String& rURL,
const String& rFileString, sal_Bool bOpen )
{
String sRet;
- SfxFileDialog* pFileDlg = new SfxFileDialog( pParent,
- bOpen ? WB_OPEN | WB_3DLOOK
- : WB_SAVEAS | WB_3DLOOK );
- pFileDlg->DisableSaveLastDirectory();
- pFileDlg->SetHelpId(HID_FILEDLG_SRCVIEW);
+
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
{
- String sCurFltr( IDX_FILE_EXTENSION );
- pFileDlg->AddFilter( rFileString, sCurFltr );
- pFileDlg->SetCurFilter( sCurFltr );
+ Sequence <Any> aProps(1);
+ aProps.getArray()[0] <<= bOpen ? C2U("FileOpen") : C2U("FileSave");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
}
+ Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
+ String sCurFltr( IDX_FILE_EXTENSION );
+ xFltMgr->appendFilter( rFileString, sCurFltr );
+ xFltMgr->setCurrentFilter( sCurFltr ) ;
+
String& rLastSaveDir = (String&)SFX_APP()->GetLastSaveDirectory();
String sSaveDir = rLastSaveDir;
if( rURL.Len() )
- pFileDlg->SetPath( rURL );
+ xFP->setDisplayDirectory( rURL );
else
{
SvtPathOptions aPathOpt;
- pFileDlg->SetPath( aPathOpt.GetUserConfigPath() );
+ xFP->setDisplayDirectory( aPathOpt.GetUserConfigPath() );
}
- if( RET_OK == pFileDlg->Execute())
- sRet = pFileDlg->GetPath();
-
- delete pFileDlg;
+ if( xFP->execute() == RET_OK )
+ {
+ sRet = xFP->getPath().getConstArray()[0];
+ }
rLastSaveDir = sSaveDir;
-
return sRet;
}
/* -----------------------------19.01.00 11:09--------------------------------
@@ -1204,7 +1219,7 @@ long SwIndexTreeLB::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
long nData = (long)pEntry->GetUserData();
if(nData != USHRT_MAX)
{
- sal_uInt16 nPos = pHeaderBar->GetItemRect( 101 + nData ).TopLeft().X();
+ long nPos = pHeaderBar->GetItemRect( 101 + nData ).TopLeft().X();
nData = nPos;
}
else
@@ -2161,7 +2176,7 @@ IMPL_LINK(SwTOXSelectTabPage, AddStylesHdl, PushButton*, pButton)
IMPL_LINK(SwTOXSelectTabPage, MenuEnableHdl, Menu*, pMenu)
{
- pMenu->EnableItem(MN_AUTOMARK_EDIT, sAutoMarkURL.Len());
+ pMenu->EnableItem(MN_AUTOMARK_EDIT, sAutoMarkURL.Len() > 0);
return 0;
}
@@ -2417,7 +2432,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
SvLBoxEntry* pEntry = GetEntry( aPos );
if( pEntry )
{
- sal_uInt16 nLevel = GetModel()->GetAbsPos(pEntry);
+ sal_uInt32 nLevel = GetModel()->GetAbsPos(pEntry);
String sEntry = pParent->GetLevelHelp(++nLevel);
if('*' == sEntry)
sEntry = GetEntryText(pEntry);
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 81f48a21904b..63f328702590 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: glossary.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: jp $ $Date: 2001-05-07 08:52:31 $
+ * last change: $Author: os $ $Date: 2001-05-15 10:03:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -96,9 +96,6 @@
#ifndef _SFXREQUEST_HXX //autogen
#include <sfx2/request.hxx>
#endif
-#ifndef _IODLG_HXX
-#include <sfx2/iodlg.hxx>
-#endif
#ifndef _SFX_FCONTNR_HXX
#include <sfx2/fcontnr.hxx>
#endif
@@ -130,6 +127,12 @@
#ifndef _UCBHELPER_CONTENT_HXX
#include <ucbhelper/content.hxx>
#endif
+#ifndef _COM_SUN_STAR_UI_XFILTERMANAGER_HPP_
+#include <com/sun/star/ui/XFilterManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
#ifndef _COM_SUN_STAR_TEXT_XAUTOTEXTGROUP_HPP_
#include <com/sun/star/text/XAutoTextGroup.hpp>
#endif
@@ -223,8 +226,11 @@
#define LONG_LENGTH 60
#define SHORT_LENGTH 30
+
using namespace ::com::sun::star;
+using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ui;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::ucb;
using namespace ::comphelper;
@@ -726,9 +732,19 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
case FN_GL_IMPORT:
{
// call the FileOpenDialog do find WinWord - Files with templates
- SfxFileDialog* pDlg = new SfxFileDialog( this, WB_OPEN | WB_3DLOOK );
+ Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
+ Reference < XFilePicker > xFP;
+ if( xMgr.is() )
+ {
+ Sequence <Any> aProps(1);
+ aProps.getArray()[0] <<= C2U("FileOpen");
+ xFP = Reference< XFilePicker >(
+ xMgr->createInstanceWithArguments(
+ C2U( "com.sun.star.ui.FilePicker" ), aProps ),
+ UNO_QUERY );
+ }
SvtPathOptions aPathOpt;
- pDlg->SetPath( aPathOpt.GetWorkPath() );
+ xFP->setDisplayDirectory(aPathOpt.GetWorkPath() );
String sWW8( C2S(FILTER_WW8) );
sal_uInt16 i = 0;
@@ -737,6 +753,8 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
SwDocShell::Factory().GetFilterContainer();
if( pFltCnt )
{
+ Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
+
const SfxFilter* pFilter;
sal_uInt16 nCount = pFltCnt->GetFilterCount();
for( i = 0; i < nCount; ++i )
@@ -744,23 +762,21 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
/*->IsAllowedAsTemplate()
&& pFilter*/->GetUserData() == sWW8 )
{
- pDlg->AddFilter( pFilter->GetUIName(),
- ((WildCard&)pFilter->GetWildcard())(),
- pFilter->GetTypeName() );
- pDlg->SetCurFilter( pFilter->GetUIName() );
- }
+ xFltMgr->appendFilter( pFilter->GetUIName(),
+ ((WildCard&)pFilter->GetWildcard()).GetWildCard() );
+ xFltMgr->setCurrentFilter( pFilter->GetUIName() ) ;
+ }
}
- if( i && RET_OK == pDlg->Execute() )
+ if( i && RET_OK == xFP->execute() )
{
- if( pGlossaryHdl->ImportGlossaries( pDlg->GetPath() ))
+ if( pGlossaryHdl->ImportGlossaries( xFP->getPath().getConstArray()[0] ))
Init();
else
{
InfoBox(this, SW_RES( MSG_NO_GLOSSARIES )).Execute();
}
}
- delete pDlg;
}
break;
diff --git a/sw/source/ui/misc/makefile.mk b/sw/source/ui/misc/makefile.mk
index 8a1476199cd8..b5126b65cf21 100644
--- a/sw/source/ui/misc/makefile.mk
+++ b/sw/source/ui/misc/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: os $ $Date: 2001-03-02 14:06:33 $
+# last change: $Author: os $ $Date: 2001-05-15 10:03:55 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -95,8 +95,7 @@ CXXFILES = \
outline.cxx \
pgfnote.cxx \
redlndlg.cxx \
- srtdlg.cxx \
- tmpldlg.cxx
+ srtdlg.cxx
SRCFILES=\
bookmark.src \
@@ -111,8 +110,7 @@ SRCFILES=\
outline.src \
pgfnote.src \
redlndlg.src \
- srtdlg.src \
- tmpldlg.src
+ srtdlg.src
SLOFILES = \
$(SLO)$/bookmark.obj \
@@ -130,8 +128,7 @@ SLOFILES = \
$(SLO)$/outline.obj \
$(SLO)$/pgfnote.obj \
$(SLO)$/redlndlg.obj \
- $(SLO)$/srtdlg.obj \
- $(SLO)$/tmpldlg.obj
+ $(SLO)$/srtdlg.obj
EXCEPTIONSFILES = \
$(SLO)$/glosdoc.obj \
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 1add64b0552d..35227e92b64a 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: grfsh.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: jp $ $Date: 2001-01-22 13:46:10 $
+ * last change: $Author: os $ $Date: 2001-05-15 09:59:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -106,9 +106,6 @@
#ifndef _SVX_SRCHITEM_HXX
#include <svx/srchitem.hxx>
#endif
-#ifndef _SVX_IMPGRF_HXX //autogen
-#include <svx/impgrf.hxx>
-#endif
#ifndef _SVX_HTMLMODE_HXX //autogen
#include <svx/htmlmode.hxx>
#endif
@@ -194,13 +191,31 @@
#ifndef _SWWAIT_HXX
#include <swwait.hxx>
#endif
-
+#ifndef _SVX_IMPGRF_HXX
+#include <svx/impgrf.hxx>
+#endif
#ifndef _SHELLS_HRC
#include <shells.hrc>
#endif
#ifndef _POPUP_HRC
#include <popup.hrc>
#endif
+#ifndef _FILEDLGHELPER_HXX
+#include <sfx2/filedlghelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKER_HPP_
+#include <com/sun/star/ui/XFilePicker.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_XFILEPICKERCONTROLACCESS_HPP_
+#include <com/sun/star/ui/XFilePickerControlAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UI_FILEPICKERELEMENTID_HPP_
+#include <com/sun/star/ui/FilePickerElementID.hpp>
+#endif
+
+using namespace ::com::sun::star::ui;
+using namespace ::com::sun::star::uno;
+using namespace ::sfx2;
#define SwGrfShell
#include "itemdef.hxx"
@@ -737,35 +752,38 @@ BOOL SwTextShell::InsertGraphicDlg()
SwView &rVw = GetView();
USHORT nHtmlMode = ::GetHtmlMode(rVw.GetDocShell());
// im HTML-Mode nur verknuepft einfuegen
- USHORT nEnable = ENABLE_ALL;
+ FileDialogHelper* pFileDlg = new FileDialogHelper( SFXWB_GRAPHIC );
+ pFileDlg->SetTitle(SW_RESSTR(STR_INSERT_GRAPHIC ));
+ Reference < XFilePicker > xFP = pFileDlg->GetFilePicker();
+ Reference < XFilePickerControlAccess > xCtrlAcc(xFP, UNO_QUERY);
if(nHtmlMode & HTMLMODE_ON)
{
- nEnable &= ~ENABLE_LINK;
- nEnable |= ENABLE_PROP_WITHOUTLINK;
+ sal_Bool bTrue = sal_True;
+ Any aVal(&bTrue, ::getBooleanCppuType());
+ xCtrlAcc->setValue( FilePickerElementID::CBX_INSERT_AS_LINK, aVal);
+ xCtrlAcc->enableControl( FilePickerElementID::CBX_INSERT_AS_LINK, sal_False);
}
- SvxImportGraphicDialog *pDlg =
- new SvxImportGraphicDialog( rVw.GetWindow(),
- SW_RESSTR(STR_INSERT_GRAPHIC ), nEnable );
- pDlg->SetPropertyHdl(LINK(this, SwTextShell, InitGraphicFrame));
-
- ASSERT( !pInsGrfSetPtr, "who has not delete the GraphicSet pointer?" );
- pInsGrfSetPtr = 0;
-
- if( pDlg->Execute() == RET_OK )
+ if( ERRCODE_NONE == pFileDlg->Execute() )
{
GetShell().StartAction();
GetShell().StartUndo(UNDO_INSERT);
- Graphic* pPreViewGrf = pDlg->GetGraphic();
-
- BOOL bAsLink = nHtmlMode & HTMLMODE_ON ? TRUE : pDlg->AsLink();
- USHORT nError = InsertGraphic( pDlg->GetPath(), pDlg->GetCurFilter(),
- bAsLink, &pDlg->GetFilter(), pPreViewGrf );
+ sal_Bool bAsLink;
+ if(nHtmlMode & HTMLMODE_ON)
+ bAsLink = sal_True;
+ else
+ {
+ Any aVal = xCtrlAcc->getValue( FilePickerElementID::CBX_INSERT_AS_LINK);
+ DBG_ASSERT(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found")
+ bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True;
+ }
+ USHORT nError = InsertGraphic( pFileDlg->GetPath(), pFileDlg->GetCurrentFilter(),
+ bAsLink, ::GetGrfFilter() );
// Format ist ungleich Current Filter, jetzt mit auto. detection
if( nError == GRFILTER_FORMATERROR )
- nError = InsertGraphic( pDlg->GetPath(), aEmptyStr, bAsLink,
- &pDlg->GetFilter(), pPreViewGrf );
+ nError = InsertGraphic( pFileDlg->GetPath(), aEmptyStr, bAsLink,
+ ::GetGrfFilter() );
RESOURCE_TYPE nResId = 0;
switch( nError )
@@ -799,17 +817,6 @@ BOOL SwTextShell::InsertGraphicDlg()
else
{
// set the specific graphic attrbutes to the graphic
- if( pInsGrfSetPtr )
- {
- // set the normal graphic attributes
- SwWrtShell& rSh = GetShell();
- rSh.SetAttr( *pInsGrfSetPtr );
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pInsGrfSetPtr->GetItemState(
- FN_SET_FRM_ALT_NAME, TRUE, &pItem ))
- rSh.SetAlternateText(
- ((const SfxStringItem*)pItem)->GetValue() );
- }
GetShell().EndAction();
bReturn = TRUE;
rVw.AutoCaption( GRAPHIC_CAP );
@@ -817,223 +824,11 @@ BOOL SwTextShell::InsertGraphicDlg()
rVw.GetWrtShell().EndUndo(UNDO_INSERT); // wegen moegl. Shellwechsel
}
- delete pInsGrfSetPtr, pInsGrfSetPtr = 0;
-
DELETEZ( pFrmMgr );
- delete pDlg;
+ delete pFileDlg;
return bReturn;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
-
-IMPL_LINK( SwTextShell, InitGraphicFrame, Button *, pButton )
-{
-//OS: pButton ist eigentlich der Pointer auf den GrafikEinfuegen-Dialog
- SwWrtShell &rSh = GetShell();
- SwViewOption aUsrPref( *rSh.GetViewOptions() );
- SvxImportGraphicDialog* pGrfDlg = (SvxImportGraphicDialog*) pButton;
- if (!pFrmMgr)
- pFrmMgr = new SwFlyFrmAttrMgr( TRUE, &rSh, FRMMGR_TYPE_GRF );
-
- static USHORT __READONLY_DATA aGrfAttrRange[] =
- {
- RES_FRMATR_BEGIN, RES_FRMATR_END-1,
- SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
-
- SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM,
- SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE,
- SID_ATTR_GRAF_FRMSIZE_PERCENT, SID_ATTR_GRAF_FRMSIZE_PERCENT,
- SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC,
-
- FN_PARAM_GRF_CONNECT, FN_PARAM_GRF_CONNECT,
- FN_PARAM_FILTER, FN_PARAM_FILTER,
- RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF,
- SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
- FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
- FN_SET_FRM_NAME, FN_SET_FRM_NAME,
- FN_KEEP_ASPECT_RATIO, FN_KEEP_ASPECT_RATIO,
- FN_PARAM_GRF_REALSIZE, FN_PARAM_GRF_DIALOG,
- SID_DOCFRAME, SID_DOCFRAME,
- SID_HTML_MODE, SID_HTML_MODE,
- FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
- 0
- };
-
- SfxItemSet aSet(GetPool(), aGrfAttrRange );
-
- const SwRect &rPg = GetShell().GetAnyCurRect(RECT_PAGE);
- SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
- aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
- aSet.Put(aFrmSize);
-
- const SwRect &rPr = GetShell().GetAnyCurRect(RECT_PAGE_PRT);
- SwFmtFrmSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
- aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
- aSet.Put(aPrtSize);
-
- aSet.Put( pFrmMgr->GetAttrSet() );
- aSet.SetParent( pFrmMgr->GetAttrSet().GetParent() );
-
- aSet.Put(SfxFrameItem( SID_DOCFRAME, GetView().GetViewFrame()->GetTopFrame()));
-
- // niemals connected, sonst darf man den Grafikdialog doppelt aufrufen!
- aSet.Put(SfxBoolItem(FN_PARAM_GRF_CONNECT, FALSE));
- aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio()));
-
- aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
-
- const Graphic* pGrf = pGrfDlg->GetGraphic();
- if(pGrf)
- {
- Size aSize = ::GetGraphicSizeTwip(*pGrf, &GetView().GetEditWin());
- aSize.Width() += pFrmMgr->CalcWidthSpace();
- aSize.Height()+= pFrmMgr->CalcHeightSpace();
- aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, aSize.Width(), aSize.Height()));
- aSet.Put(SvxSizeItem( FN_PARAM_GRF_REALSIZE, aSize ));
- aSet.Put( SvxSizeItem( SID_ATTR_GRAF_FRMSIZE, aSize ));
-
- String sGrfNm( pGrfDlg->GetPath() );
- if( sGrfNm.Len() )
- {
- aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm,
- INET_HEX_ESCAPE,
- INetURLObject::DECODE_UNAMBIGUOUS,
- RTL_TEXTENCODING_UTF8 ),
- aEmptyStr, GPOS_LT,
- SID_ATTR_GRAF_GRAPHIC ));
- }
- else
- {
- aSet.Put( SvxBrushItem( *pGrf, GPOS_LT, SID_ATTR_GRAF_GRAPHIC ));
- }
- }
-
-
- SwFrmDlg *pDlg = new SwFrmDlg( GetView().GetViewFrame(), pButton,
- aSet, pGrf == 0, DLG_FRM_GRF );
- if( pDlg->Execute() )
- {
- SfxItemSet* pSet = (SfxItemSet*)pDlg->GetOutputItemSet();
-
- // change the 2 frmsize SizeItems to the correct SwFrmSizeItem
- const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pSet->GetItemState(
- SID_ATTR_GRAF_FRMSIZE, FALSE, &pItem ))
- {
- SwFmtFrmSize aSize;
- const Size& rSz = ((SvxSizeItem*)pItem)->GetSize();
- aSize.SetWidth( rSz.Width() );
- aSize.SetHeight( rSz.Height() );
-
- if( SFX_ITEM_SET == pSet->GetItemState(
- SID_ATTR_GRAF_FRMSIZE_PERCENT, FALSE, &pItem ))
- {
- const Size& rSz = ((SvxSizeItem*)pItem)->GetSize();
- aSize.SetWidthPercent( rSz.Width() );
- aSize.SetHeightPercent( rSz.Height() );
- }
- pSet->Put( aSize );
- }
-
- pFrmMgr->SetAttrSet( *pSet );
-
- if( SFX_ITEM_SET == pSet->GetItemState(FN_KEEP_ASPECT_RATIO, TRUE, &pItem))
- {
- aUsrPref.SetKeepRatio( ((const SfxBoolItem*)pItem)->GetValue() );
- SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
- }
-
- if( pInsGrfSetPtr )
- pInsGrfSetPtr->ClearItem();
- else
- pInsGrfSetPtr = new SfxItemSet( rSh.GetAttrPool(),
- RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF,
- FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
- 0 );
-
- pInsGrfSetPtr->Put( *pSet );
- if( !pInsGrfSetPtr->Count() )
- delete pInsGrfSetPtr, pInsGrfSetPtr = 0;
- }
-
- delete pDlg;
-
- return 0;
-}
-
-/*------------------------------------------------------------------------
-
- $Log: not supported by cvs2svn $
- Revision 1.8 2000/12/22 12:07:32 jp
- Bug #81672#: asynch loaded graphics for status updates
-
- Revision 1.7 2000/12/02 15:23:54 jp
- Task #80752#: integrate the grafik filter
-
- Revision 1.6 2000/11/28 20:36:10 jp
- task #80795#: ReRead and InsertGrafik with GraphicObject
-
- Revision 1.5 2000/11/24 18:01:42 jp
- Task #80752#: control for imagefilter
-
- Revision 1.4 2000/10/20 13:41:56 jp
- use correct INetURL-Decode enum
-
- Revision 1.3 2000/10/06 13:36:37 jp
- should changes: don't use IniManager
-
- Revision 1.2 2000/10/05 11:35:18 jp
- should change: remove image
-
- Revision 1.1.1.1 2000/09/18 17:14:46 hr
- initial import
-
- Revision 1.134 2000/09/18 16:06:04 willem.vandorp
- OpenOffice header added.
-
- Revision 1.133 2000/09/07 15:59:29 os
- change: SFX_DISPATCHER/SFX_BINDINGS removed
-
- Revision 1.132 2000/08/25 14:08:54 jp
- Graphic Crop-Attribut and TabPage exported to SVX
-
- Revision 1.131 2000/08/17 11:43:17 jp
- remove the SW graphicmanager and UI with decoded URLs
-
- Revision 1.130 2000/08/17 06:34:11 jp
- Bug #77713#: GetAttrState - Transparency not for animated graphics and metafiles
-
- Revision 1.129 2000/08/08 13:44:14 os
- #77423# separate graphic shell
-
- Revision 1.128 2000/08/02 08:04:26 jp
- changes for graphic attributes
-
- Revision 1.127 2000/07/31 19:25:36 jp
- new attributes for CJK/CTL and graphic
-
- Revision 1.126 2000/05/26 07:21:32 os
- old SW Basic API Slots removed
-
- Revision 1.125 2000/05/10 11:53:02 os
- Basic API removed
-
- Revision 1.124 2000/04/18 14:58:24 os
- UNICODE
-
- Revision 1.123 2000/02/11 14:57:17 hr
- #70473# changes for unicode ( patched by automated patchtool )
-
- Revision 1.122 1999/11/22 14:55:36 os
- operator precedence
-
- Revision 1.121 1999/03/18 13:40:50 OS
- #61169# #61489# Masseinheiten fuer Text u. HTML am Module setzen, nicht an der App
-
-------------------------------------------------------------------------*/
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index c6303480c5b7..cd612f83b75e 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: textsh.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jp $ $Date: 2001-02-27 14:38:37 $
+ * last change: $Author: os $ $Date: 2001-05-15 09:59:40 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -930,7 +930,7 @@ void SwTextShell::ExecTransliteration( SfxRequest & rReq )
SwTextShell::SwTextShell(SwView &rView) :
- SwBaseShell(rView), pPostItFldMgr( 0 ), pInsGrfSetPtr( 0 )
+ SwBaseShell(rView), pPostItFldMgr( 0 )
{
SetName(String::CreateFromAscii("Text"));
SetHelpId(SW_TEXTSHELL);
@@ -1028,6 +1028,9 @@ void SwTextShell::InsertSymbol(const String& rChars, const String& rFontName)
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
+ Revision 1.6 2001/02/27 14:38:37 jp
+ move transliteration menu into SVX
+
Revision 1.5 2001/01/04 17:22:20 hr
#65293#: typo