summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-12-21 20:33:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-12-29 18:02:26 +0000
commit5aa0ac02a0cb9b7a387366f841bc603cbe396eaa (patch)
tree01b2f9529a5807c131f1582abbd7c25b93ab4017 /sfx2
parentd906615e35c1a255c58c3f2085c8e2f110eb522a (diff)
callcatcher: update unused code list
Change-Id: I47467b53705f8059a829126a598e29a1105df13c
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/UI_sfx.mk1
-rw-r--r--sfx2/inc/sfx2/app.hxx5
-rw-r--r--sfx2/inc/sfx2/basedlgs.hxx12
-rw-r--r--sfx2/inc/sfx2/doctempl.hxx11
-rw-r--r--sfx2/inc/sfx2/objsh.hxx6
-rw-r--r--sfx2/inc/sfx2/sfx.hrc2
-rw-r--r--sfx2/source/appl/app.src7
-rw-r--r--sfx2/source/appl/appopen.cxx77
-rw-r--r--sfx2/source/dialog/basedlgs.cxx15
-rw-r--r--sfx2/source/dialog/templdlg.cxx51
-rw-r--r--sfx2/source/doc/doctempl.cxx428
-rw-r--r--sfx2/source/doc/objcont.cxx134
-rw-r--r--sfx2/source/inc/templdgi.hxx2
-rw-r--r--sfx2/uiconfig/ui/templatemanagementdialog.ui403
14 files changed, 1 insertions, 1153 deletions
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
index a00ed9849a3c..c5077bb27bf4 100644
--- a/sfx2/UI_sfx.mk
+++ b/sfx2/UI_sfx.mk
@@ -19,7 +19,6 @@ $(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/password \
sfx2/uiconfig/ui/printeroptionsdialog \
sfx2/uiconfig/ui/securityinfopage \
- sfx2/uiconfig/ui/templatemanagementdialog \
))
# vim: set noet sw=4 ts=4:
diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx
index 5ff15f277b2e..6fe8bc071809 100644
--- a/sfx2/inc/sfx2/app.hxx
+++ b/sfx2/inc/sfx2/app.hxx
@@ -200,11 +200,6 @@ public:
void NotifyEvent(const SfxEventHint& rEvent, bool bSynchron = true );
sal_Bool IsDowning() const;
sal_Bool IsSecureURL( const INetURLObject &rURL, const String *pReferer ) const;
- static SfxObjectShellRef DocAlreadyLoaded( const String &rName,
- sal_Bool bSilent,
- sal_Bool bActivate,
- sal_Bool bForbidVisible = sal_False,
- const String* pPostStr = 0);
void ResetLastDir();
SAL_DLLPRIVATE static SfxApplication* Get() { return pApp;}
diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx
index 2251eaf01226..2d3abba9ab1d 100644
--- a/sfx2/inc/sfx2/basedlgs.hxx
+++ b/sfx2/inc/sfx2/basedlgs.hxx
@@ -40,18 +40,6 @@ class HelpButton;
class Button;
class FixedLine;
-// class SfxModalDefParentHelper -----------------------------------------
-
-class SfxModalDefParentHelper
-{
-private:
- Window *pOld;
-
-public:
- SfxModalDefParentHelper(Window* pWindow);
- ~SfxModalDefParentHelper();
-};
-
// class SfxModalDialog --------------------------------------------------
class SFX2_DLLPUBLIC SfxModalDialog: public ModalDialog
diff --git a/sfx2/inc/sfx2/doctempl.hxx b/sfx2/inc/sfx2/doctempl.hxx
index 507117ce8538..01d398f1aa7c 100644
--- a/sfx2/inc/sfx2/doctempl.hxx
+++ b/sfx2/inc/sfx2/doctempl.hxx
@@ -60,17 +60,14 @@ public:
const SfxDocumentTemplates &operator=(const SfxDocumentTemplates &);
- sal_Bool Rescan( );
void ReInitFromComponent();
- sal_Bool IsRegionLoaded( sal_uInt16 nIdx ) const;
sal_uInt16 GetRegionCount() const;
const String& GetRegionName(sal_uInt16 nIdx) const; //dv!
String GetFullRegionName(sal_uInt16 nIdx) const;
sal_uInt16 GetCount(sal_uInt16 nRegion) const;
const String& GetName(sal_uInt16 nRegion, sal_uInt16 nIdx) const; //dv!
- String GetFileName(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
String GetPath(sal_uInt16 nRegion, sal_uInt16 nIdx) const;
// Allows to retrieve the target template URL from the UCB
@@ -94,14 +91,10 @@ public:
sal_uInt16 nSourceIdx);
sal_Bool Delete(sal_uInt16 nRegion, sal_uInt16 nIdx);
sal_Bool InsertDir(const String &rText, sal_uInt16 nRegion);
- sal_Bool SetName(const String &rName, sal_uInt16 nRegion, sal_uInt16 nIdx);
sal_Bool CopyTo(sal_uInt16 nRegion, sal_uInt16 nIdx, const String &rName) const;
sal_Bool CopyFrom(sal_uInt16 nRegion, sal_uInt16 nIdx, String &rName);
- SfxObjectShellRef CreateObjectShell(sal_uInt16 nRegion, sal_uInt16 nIdx);
- sal_Bool DeleteObjectShell(sal_uInt16, sal_uInt16);
-
sal_Bool GetFull( const String& rRegion, const String& rName, String& rPath );
sal_Bool GetLogicNames( const String& rPath, String& rRegion, String& rName ) const;
@@ -121,10 +114,6 @@ public:
So set <arg>_bSmart</arg> to <TRUE/> to do a check for necessity first.
*/
void Update( sal_Bool _bSmart = sal_True );
-
- // allows to detect whether it is allowed to delete ( at least partially )
- // a group or a template, or to edit a template
- sal_Bool HasUserContents( sal_uInt16 nRegion, sal_uInt16 nIdx ) const;
};
#endif // #ifndef _SFXDOCTEMPL_HXX
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index d2a3b3d76440..8e1e2f6e0246 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -526,12 +526,6 @@ public:
sal_uInt16 nIdx2 = INDEX_IGNORE,
sal_uInt16 nIdx3 = INDEX_IGNORE);
- sal_Bool Print( Printer &rPrt,
- sal_uInt16 nIdx1,
- sal_uInt16 nIdx2 = INDEX_IGNORE,
- sal_uInt16 nIdx3 = INDEX_IGNORE,
- const String *pObjectName = 0 );
-
virtual void LoadStyles( SfxObjectShell &rSource );
void ReadNote( INote * );
void UpdateNote( INote * );
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index c2103d32c9ac..500063c7575d 100644
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -129,8 +129,6 @@
#define RID_APPTITLE (RID_SFX_START+4)
-#define RID_DOCALREADYLOADED_DLG (RID_SFX_START+1)
-
#define DLG_DOCINFO_EDT (RID_SFX_START+6)
#define TP_MANAGE_STYLES (RID_SFX_START+7)
#define DLG_STYLE_DESIGNER (RID_SFX_START+8)
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
index be348fdab1dc..78457ae6b8be 100644
--- a/sfx2/source/appl/app.src
+++ b/sfx2/source/appl/app.src
@@ -59,16 +59,11 @@ QueryBox MSG_QUERY_LASTVERSION
Message [ en-US ] = "Cancel all changes?" ;
};
-InfoBox RID_DOCALREADYLOADED_DLG
-{
- Message [ en-US ] = "Document already open." ;
-};
-
ErrorBox MSG_ERR_NO_WEBBROWSER_FOUND
{
BUTTONS = WB_OK ;
DEFBUTTON = WB_DEF_OK ;
- Message[ en-US ] = "%PRODUCTNAME could not find a web browser on your system. Please check your Desktop Preferences or install a web browser (for example, Mozilla) in the default location requested during the browser installation." ;
+ Message[ en-US ] = "%PRODUCTNAME could not find a web browser on your system. Please check your Desktop Preferences or install a web browser (for example, Firefox) in the default location requested during the browser installation." ;
};
ErrorBox MSG_ERR_NO_ABS_URI_REF
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index f9714d41a636..5b9e5bef742c 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -138,83 +138,6 @@ void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& ) thr
{
}
-SfxObjectShellRef SfxApplication::DocAlreadyLoaded
-(
- const String& rName, // Name of Documents including path
- sal_Bool bSilent, // sal_True: do not ask for a new view
- sal_Bool bActivate, // existing view to be activated
- sal_Bool bForbidVisible,
- const String* pPostStr
-)
-
-/* [Description]
-
- Determines whether a document with the name 'rName' already is loaded and
- returns a pointer to this document.
-
- If the document is not loaded, a 0-pointer is returned.
-*/
-
-{
- // prepare to search for names as URL
- INetURLObject aUrlToFind( rName );
- DBG_ASSERT( aUrlToFind.GetProtocol() != INET_PROT_NOT_VALID, "Invalid URL" );
- String aPostString;
- if ( pPostStr )
- aPostString = *pPostStr;
-
- // still open?
- SfxObjectShellRef xDoc;
-
- if ( !aUrlToFind.HasError() )
- {
- // then with the normally open Documents
- if ( !xDoc.Is() )
- {
- xDoc = SfxObjectShell::GetFirst( 0, sal_False ); // also hidden Documents
- while( xDoc.Is() )
- {
- if ( xDoc->GetMedium() &&
- xDoc->GetCreateMode() == SFX_CREATE_MODE_STANDARD &&
- !xDoc->IsAbortingImport() && !xDoc->IsLoading() )
- {
- // Comparisons between URLs
- INetURLObject aUrl( xDoc->GetMedium()->GetName() );
- if ( !aUrl.HasError() && aUrl == aUrlToFind &&
- (!bForbidVisible || !SfxViewFrame::GetFirst( xDoc, sal_True )) &&
- !xDoc->IsLoading())
- {
- break;
- }
- }
- xDoc = SfxObjectShell::GetNext( *xDoc, 0, sal_False );
- }
- }
- }
-
- // Found?
- if ( xDoc.Is() && bActivate )
- {
- DBG_ASSERT(!bForbidVisible, "Invisible can not be enabled" );
-
- SfxViewFrame* pFrame;
- for( pFrame = SfxViewFrame::GetFirst( xDoc );
- pFrame && !pFrame->IsVisible();
- pFrame = SfxViewFrame::GetNext( *pFrame, xDoc ) ) ;
- if ( pFrame )
- {
- SfxViewFrame *pCur = SfxViewFrame::Current();
- if ( !bSilent && pFrame == pCur )
- InfoBox( 0, SfxResId(RID_DOCALREADYLOADED_DLG)).Execute();
- if ( bActivate )
- {
- pFrame->MakeActive_Impl( sal_True );
- }
- }
- }
- return xDoc;
-}
-
//====================================================================
void SetTemplate_Impl( const String &rFileName,
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index e438d7eb6792..f0a9d7de17fb 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -93,21 +93,6 @@ void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-// class SfxModalDefParentHelper -----------------------------------------
-
-SfxModalDefParentHelper::SfxModalDefParentHelper( Window *pWindow)
-{
- pOld = Application::GetDefDialogParent();
- Application::SetDefDialogParent( pWindow );
-}
-
-// -----------------------------------------------------------------------
-
-SfxModalDefParentHelper::~SfxModalDefParentHelper()
-{
- Application::SetDefDialogParent( pOld );
-}
-
// -----------------------------------------------------------------------
void SfxModalDialog::SetDialogData_Impl()
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 0af6d770116f..b315453f691c 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -353,15 +353,6 @@ SfxActionListBox::SfxActionListBox
//-------------------------------------------------------------------------
-SfxActionListBox::SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent,
- const ResId &rResId) :
- DropListBox_Impl(pParent->GetWindow(), rResId, pParent)
-{
- EnableContextMenuHandling();
-}
-
-//-------------------------------------------------------------------------
-
PopupMenu* SfxActionListBox::CreateContextMenu( void )
{
@@ -766,48 +757,6 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
//-------------------------------------------------------------------------
-SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* pW ) :
-
- aISfxTemplateCommon ( this ),
- pBindings ( pB ),
- pWindow ( pW ),
- pModule ( NULL ),
- pTimer ( NULL ),
- pStyleSheetPool ( NULL ),
- pTreeBox ( NULL ),
- pCurObjShell ( NULL ),
- m_pDeletionWatcher ( NULL ),
-
- aFmtLb ( this, SfxResId( BT_VLIST ) ),
- aFilterLb ( pW, SfxResId( BT_FLIST ) ),
-
- nActFamily ( 0xffff ),
- nActFilter ( 0 ),
- nAppFilter ( 0 ),
-
- bDontUpdate ( sal_False ),
- bIsWater ( sal_False ),
- bEnabled ( sal_True ),
- bUpdate ( sal_False ),
- bUpdateFamily ( sal_False ),
- bCanEdit ( sal_False ),
- bCanDel ( sal_False ),
- bCanNew ( sal_True ),
- bCanHide ( sal_True ),
- bCanShow ( sal_False ),
- bWaterDisabled ( sal_False ),
- bNewByExampleDisabled ( sal_False ),
- bUpdateByExampleDisabled( sal_False ),
- bTreeDrag ( sal_True ),
- bHierarchical ( sal_False ),
- bBindingUpdate ( sal_True )
-
-{
- aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT );
-}
-
-//-------------------------------------------------------------------------
-
sal_uInt16 SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(sal_uInt16 nId)
{
const SfxStyleFamilyItem *pItem = pStyleFamilies->at( nId );
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 7d258b46ff95..b17b76e9e1ec 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -143,9 +143,6 @@ public:
void SetHierarchyURL( const OUString& rURL) { maOwnURL = rURL; }
int Compare( const OUString& rTitle ) const;
-
- SfxObjectShellRef CreateObjectShell();
- sal_Bool DeleteObjectShell();
};
}
@@ -179,7 +176,6 @@ public:
DocTempl_EntryData_Impl* GetEntry( const OUString& rName ) const;
const OUString& GetTitle() const { return maTitle; }
- const OUString& GetTargetURL();
const OUString& GetHierarchyURL();
size_t GetCount() const;
@@ -383,23 +379,6 @@ sal_uInt16 SfxDocumentTemplates::GetRegionCount() const
//------------------------------------------------------------------------
-sal_Bool SfxDocumentTemplates::IsRegionLoaded( sal_uInt16 nIdx ) const
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- if ( !pImp->Construct() )
- return sal_False;
-
- RegionData_Impl *pData = pImp->GetRegion( nIdx );
-
- if ( pData )
- return sal_True;
- else
- return sal_False;
-}
-
-//------------------------------------------------------------------------
-
sal_uInt16 SfxDocumentTemplates::GetCount
(
sal_uInt16 nRegion /* Region index whose number is
@@ -472,42 +451,6 @@ const String& SfxDocumentTemplates::GetName
//------------------------------------------------------------------------
-String SfxDocumentTemplates::GetFileName
-(
- sal_uInt16 nRegion, // Region Index, in which the entry lies
- sal_uInt16 nIdx // Index of the entry
-) const
-
-/* [Description]
-
- Returns the file name of an entry in Region
-
- [Return value] File name of the entry
-*/
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- if ( !pImp->Construct() )
- return String();
-
- DocTempl_EntryData_Impl *pEntry = NULL;
- RegionData_Impl *pRegion = pImp->GetRegion( nRegion );
-
- if ( pRegion )
- pEntry = pRegion->GetEntry( nIdx );
-
- if ( pEntry )
- {
- INetURLObject aURLObj( pEntry->GetTargetURL() );
- return aURLObj.getName( INetURLObject::LAST_SEGMENT, true,
- INetURLObject::DECODE_WITH_CHARSET );
- }
- else
- return String();
-}
-
-//------------------------------------------------------------------------
-
String SfxDocumentTemplates::GetPath
(
sal_uInt16 nRegion, // Region Index, in which the entry lies
@@ -1098,190 +1041,6 @@ sal_Bool SfxDocumentTemplates::InsertDir
//------------------------------------------------------------------------
-sal_Bool SfxDocumentTemplates::SetName
-(
- const String& rName, // Der zu setzende Name
- sal_uInt16 nRegion, // Region Index
- sal_uInt16 nIdx /* Index of the entry oder USHRT_MAX,
- if a directory is meant. */
-)
-
-/* [Description]
-
- Change the name of an entry or a directory
-
- [Return value]
-
- sal_Bool sal_True, Action could be performed
- sal_False, Action could not be performed
-
-*/
-
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- if ( ! pImp->Construct() )
- return sal_False;
-
- RegionData_Impl *pRegion = pImp->GetRegion( nRegion );
- DocTempl_EntryData_Impl *pEntry = NULL;
-
- if ( !pRegion )
- return sal_False;
-
- uno::Reference< XDocumentTemplates > xTemplates = pImp->getDocTemplates();
- OUString aEmpty;
-
- if ( nIdx == USHRT_MAX )
- {
- if ( pRegion->GetTitle() == OUString( rName ) )
- return sal_True;
-
- // we have to rename a region
- if ( xTemplates->renameGroup( pRegion->GetTitle(), rName ) )
- {
- pRegion->SetTitle( rName );
- pRegion->SetTargetURL( aEmpty );
- pRegion->SetHierarchyURL( aEmpty );
- return sal_True;
- }
- }
- else
- {
- pEntry = pRegion->GetEntry( nIdx );
-
- if ( !pEntry )
- return sal_False;
-
- if ( pEntry->GetTitle() == OUString( rName ) )
- return sal_True;
-
- if ( xTemplates->renameTemplate( pRegion->GetTitle(),
- pEntry->GetTitle(),
- rName ) )
- {
- pEntry->SetTitle( rName );
- pEntry->SetTargetURL( aEmpty );
- pEntry->SetHierarchyURL( aEmpty );
- return sal_True;
- }
- }
-
- return sal_False;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool SfxDocumentTemplates::Rescan()
-
-/* [Description]
-
- Comparison of administrative data with the current state on disk.
- The logical name for which no file exists, will be removed from the
- administrative structure. Files for which no record exists will be included.
-
- [Return value]
-
- sal_Bool sal_True, Action could be performed
- sal_False, Action could not be performed
-
- [Cross-references]
-
- <SfxTemplateDir::Scan(sal_Bool bDirectory, sal_Bool bSave)>
- <SfxTemplateDir::Freshen(const SfxTemplateDir &rNew)>
-*/
-{
- if ( !pImp->Construct() )
- return sal_False;
-
- pImp->Rescan();
-
- return sal_True;
-}
-
-//------------------------------------------------------------------------
-
-SfxObjectShellRef SfxDocumentTemplates::CreateObjectShell
-(
- sal_uInt16 nRegion, // Region Index
- sal_uInt16 nIdx // Index of the entry
-)
-
-/* [Description]
-
- Access to the document shell of an entry
-
- [Return value]
-
- SfxObjectShellRef Referece to the ObjectShell
-
- [Cross-references]
-
- <SfxTemplateDirEntry::CreateObjectShell()>
- <SfxDocumentTemplates::DeleteObjectShell(sal_uInt16, sal_uInt16)>
-*/
-
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- if ( !pImp->Construct() )
- return NULL;
-
- RegionData_Impl *pRegion = pImp->GetRegion( nRegion );
- DocTempl_EntryData_Impl *pEntry = NULL;
-
- if ( pRegion )
- pEntry = pRegion->GetEntry( nIdx );
-
- if ( pEntry )
- return pEntry->CreateObjectShell();
- else
- return NULL;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool SfxDocumentTemplates::DeleteObjectShell
-(
- sal_uInt16 nRegion, // Region Index
- sal_uInt16 nIdx // Index of the entry
-)
-
-/* [Description]
-
- Releasing the ObjectShell of an entry
-
- [Return value]
-
- sal_Bool sal_True, Action could be performed
- sal_False, Action could not be performed
-
- [Cross-references]
-
- <SfxTemplateDirEntry::DeleteObjectShell()>
- <SfxDocumentTemplates::CreateObjectShell(sal_uInt16, sal_uInt16)>
-*/
-
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- if ( ! pImp->Construct() )
- return sal_True;
-
- RegionData_Impl *pRegion = pImp->GetRegion( nRegion );
- DocTempl_EntryData_Impl *pEntry = NULL;
-
- if ( pRegion )
- pEntry = pRegion->GetEntry( nIdx );
-
- if ( pEntry )
- return pEntry->DeleteObjectShell();
- else
- return sal_True;
-}
-
-//------------------------------------------------------------------------
-
sal_Bool SfxDocumentTemplates::GetFull
(
const String &rRegion, // Region Name
@@ -1458,60 +1217,6 @@ void SfxDocumentTemplates::ReInitFromComponent()
pImp->ReInitFromComponent();
}
-
-sal_Bool SfxDocumentTemplates::HasUserContents( sal_uInt16 nRegion, sal_uInt16 nIdx ) const
-{
- DocTemplLocker_Impl aLocker( *pImp );
-
- sal_Bool bResult = sal_False;
-
- RegionData_Impl* pRegion = pImp->GetRegion( nRegion );
-
- if ( pRegion )
- {
- ::rtl::OUString aRegionTargetURL = pRegion->GetTargetURL();
- if ( !aRegionTargetURL.isEmpty() )
- {
- sal_uInt16 nLen = 0;
- sal_uInt16 nStartInd = 0;
-
- if( nIdx == USHRT_MAX )
- {
- // this is a folder
- // check whether there is at least one editable template
- nLen = ( sal_uInt16 )pRegion->GetCount();
- nStartInd = 0;
- if ( nLen == 0 )
- bResult = sal_True; // the writing part of empty folder with writing URL can be removed
- }
- else
- {
- // this is a template
- // check whether the template is inserted by user
- nLen = 1;
- nStartInd = nIdx;
- }
-
- for ( sal_uInt16 nInd = nStartInd; nInd < nStartInd + nLen; nInd++ )
- {
- DocTempl_EntryData_Impl* pEntryData = pRegion->GetEntry( nInd );
- if ( pEntryData )
- {
- ::rtl::OUString aEntryTargetURL = pEntryData->GetTargetURL();
- if ( !aEntryTargetURL.isEmpty()
- && ::utl::UCBContentHelper::IsSubPath( aRegionTargetURL, aEntryTargetURL ) )
- {
- bResult = sal_True;
- break;
- }
- }
- }
- }
- }
-
- return bResult;
-}
-
// -----------------------------------------------------------------------
DocTempl_EntryData_Impl::DocTempl_EntryData_Impl( RegionData_Impl* pParent,
const OUString& rTitle )
@@ -1530,114 +1235,6 @@ int DocTempl_EntryData_Impl::Compare( const OUString& rTitle ) const
}
// -----------------------------------------------------------------------
-SfxObjectShellRef DocTempl_EntryData_Impl::CreateObjectShell()
-{
- if( ! mxObjShell.Is() )
- {
- mbIsOwner = sal_False;
- sal_Bool bDum = sal_False;
- SfxApplication *pSfxApp = SFX_APP();
- String aTargetURL = GetTargetURL();
-
- mxObjShell = pSfxApp->DocAlreadyLoaded( aTargetURL, sal_True, bDum );
-
- if( ! mxObjShell.Is() )
- {
- mbIsOwner = sal_True;
- SfxMedium *pMed=new SfxMedium(
- aTargetURL,(STREAM_STD_READWRITE | STREAM_SHARE_DENYALL) );
- const SfxFilter* pFilter = NULL;
- pMed->UseInteractionHandler(sal_True);
- if( pSfxApp->GetFilterMatcher().GuessFilter(
- *pMed, &pFilter, SFX_FILTER_TEMPLATE, 0 ) ||
- (pFilter && !pFilter->IsOwnFormat()) ||
- (pFilter && !pFilter->UsesStorage()) )
- {
- SfxErrorContext aEc( ERRCTX_SFX_LOADTEMPLATE,
- aTargetURL );
- delete pMed;
- mbDidConvert=sal_True;
- sal_uIntPtr lErr;
- if ( mxObjShell.Is() ) {
- lErr = pSfxApp->LoadTemplate( mxObjShell,aTargetURL);
- if( lErr != ERRCODE_NONE )
- ErrorHandler::HandleError(lErr);
- }
-
- }
- else if (pFilter)
- {
- mbDidConvert=sal_False;
- mxObjShell = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_ORGANIZER );
- if ( mxObjShell.Is() )
- {
- mxObjShell->DoInitNew(0);
- // TODO/LATER: make sure that we don't use binary templates!
- if( mxObjShell->LoadFrom( *pMed ) )
- {
- mxObjShell->DoSaveCompleted( pMed );
- }
- else
- mxObjShell.Clear();
- }
- }
- }
- }
-
- return (SfxObjectShellRef)(SfxObjectShell*) mxObjShell;
-}
-
-//------------------------------------------------------------------------
-sal_Bool DocTempl_EntryData_Impl::DeleteObjectShell()
-{
- sal_Bool bRet = sal_True;
-
- if ( mxObjShell.Is() )
- {
- if( mxObjShell->IsModified() )
- {
- // Here we also save, if the Template is being processed ...
- bRet = sal_False;
-
- if ( mbIsOwner )
- {
- if( mbDidConvert )
- {
- bRet=mxObjShell->PreDoSaveAs_Impl(
- GetTargetURL(),
- mxObjShell->GetFactory().GetFilterContainer()->GetAnyFilter( SFX_FILTER_EXPORT | SFX_FILTER_IMPORT, SFX_FILTER_INTERNAL )->GetFilterName(), 0 );
- }
- else
- {
- if( mxObjShell->Save() )
- {
- uno::Reference< embed::XTransactedObject > xTransacted( mxObjShell->GetStorage(), uno::UNO_QUERY );
- DBG_ASSERT( xTransacted.is(), "Storage must implement XTransactedObject!\n" );
- if ( xTransacted.is() )
- {
- try
- {
- xTransacted->commit();
- bRet = sal_True;
- }
- catch( uno::Exception& )
- {
- }
- }
- }
- }
- }
- }
-
- if( bRet )
- {
- mxObjShell.Clear();
- }
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------
const OUString& DocTempl_EntryData_Impl::GetHierarchyURL()
{
if ( maOwnURL.isEmpty() )
@@ -1817,31 +1414,6 @@ const OUString& RegionData_Impl::GetHierarchyURL()
}
// -----------------------------------------------------------------------
-const OUString& RegionData_Impl::GetTargetURL()
-{
- if ( maTargetURL.isEmpty() )
- {
- uno::Reference< XCommandEnvironment > aCmdEnv;
- Content aRegion;
-
- if ( Content::create( GetHierarchyURL(), aCmdEnv, comphelper::getProcessComponentContext(), aRegion ) )
- {
- OUString aPropName( TARGET_DIR_URL );
-
- getTextProperty_Impl( aRegion, aPropName, maTargetURL );
- // The targeturl must be substituted: $(baseinsturl) (#i32656#)
- maTargetURL = SvtPathOptions().SubstituteVariable( maTargetURL );
- }
- else
- {
- SAL_WARN( "sfx2.doc", "GetTargetURL(): Could not create hierarchy content!" );
- }
- }
-
- return maTargetURL;
-}
-
-// -----------------------------------------------------------------------
DocTempl_EntryData_Impl* RegionData_Impl::GetEntry( const OUString& rName ) const
{
sal_Bool bFound = sal_False;
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 118851ec8711..e7bd7f3ac5d9 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -633,140 +633,6 @@ sal_Bool SfxObjectShell::Remove
//--------------------------------------------------------------------
-sal_Bool SfxObjectShell::Print
-(
- Printer& rPrt,
- sal_uInt16 nIdx1,
- sal_uInt16 /*nIdx2*/,
- sal_uInt16 /*nIdx3*/,
- const String* pObjectName
-)
-{
- switch(nIdx1)
- {
- case CONTENT_STYLE:
- {
- SfxStyleSheetBasePool *pStylePool = GetStyleSheetPool();
- SetOrganizerSearchMask(pStylePool);
- SfxStyleSheetIterator* pIter = pStylePool->CreateIterator(
- pStylePool->GetSearchFamily(), pStylePool->GetSearchMask() );
- SfxStyleSheetBase *pStyle = pIter->First();
- if ( !pStyle )
- return sal_True;
-
- // prepare adaptor for old style StartPage/EndPage printing
- boost::shared_ptr< Printer > pPrinter( new Printer( rPrt.GetJobSetup() ) );
- vcl::OldStylePrintAdaptor* pAdaptor = new vcl::OldStylePrintAdaptor( pPrinter );
- boost::shared_ptr< vcl::PrinterController > pController( pAdaptor );
-
- pAdaptor->StartPage();
-
- pPrinter->SetMapMode(MapMode(MAP_10TH_MM));
- Font aFont( DEFINE_CONST_UNICODE( "Arial" ), Size(0, 64)); // 18pt
- aFont.SetWeight(WEIGHT_BOLD);
- pPrinter->SetFont(aFont);
- const Size aPageSize(pPrinter->GetOutputSize());
- const sal_uInt16 nXIndent = 200;
- sal_uInt16 nYIndent = 200;
- Point aOutPos(nXIndent, nYIndent);
- String aHeader(SfxResId(STR_PRINT_STYLES_HEADER).toString());
- if ( pObjectName )
- aHeader += *pObjectName;
- else
- aHeader += GetTitle();
- long nTextHeight( pPrinter->GetTextHeight() );
- pPrinter->DrawText(aOutPos, aHeader);
- aOutPos.Y() += nTextHeight;
- aOutPos.Y() += nTextHeight/2;
- aFont.SetSize(Size(0, 35)); // 10pt
- while(pStyle)
- {
- // print template name
- String aStr(pStyle->GetName());
- aFont.SetWeight(WEIGHT_BOLD);
- pPrinter->SetFont(aFont);
- nTextHeight = pPrinter->GetTextHeight();
- // check for new page
- if ( aOutPos.Y() + nTextHeight*2 >
- aPageSize.Height() - (long) nYIndent )
- {
- pAdaptor->EndPage();
- pAdaptor->StartPage();
- aOutPos.Y() = nYIndent;
- }
- pPrinter->DrawText(aOutPos, aStr);
- aOutPos.Y() += nTextHeight;
-
- // print template description
- aFont.SetWeight(WEIGHT_NORMAL);
- pPrinter->SetFont(aFont);
- aStr = pStyle->GetDescription();
- const char cDelim = ' ';
- sal_uInt16 nStart = 0, nIdx = 0;
-
- nTextHeight = pPrinter->GetTextHeight();
- // break text into lines
- while(nIdx < aStr.Len())
- {
- sal_uInt16 nOld = nIdx;
- long nTextWidth;
- nIdx = aStr.Search(cDelim, nStart);
- nTextWidth = pPrinter->GetTextWidth(aStr, nStart, nIdx-nStart);
- while(nIdx != STRING_NOTFOUND &&
- aOutPos.X() + nTextWidth <
- aPageSize.Width() - (long) nXIndent)
- {
- nOld = nIdx;
- nIdx = aStr.Search(cDelim, nIdx+1);
- nTextWidth = pPrinter->GetTextWidth(aStr, nStart, nIdx-nStart);
- }
- String aTmp(aStr, nStart, nIdx == STRING_NOTFOUND?
- STRING_LEN :
- nOld-nStart);
- if ( aTmp.Len() )
- {
- nStart = nOld+1; // trailing space
- }
- else
- {
- sal_uInt16 nChar = 1;
- while(
- nStart + nChar < aStr.Len() &&
- aOutPos.X() + pPrinter->GetTextWidth(
- aStr, nStart, nChar) <
- aPageSize.Width() - nXIndent)
- ++nChar;
- aTmp = String(aStr, nStart, nChar-1);
- nIdx = nStart + nChar;
- nStart = nIdx;
- }
- if ( aOutPos.Y() + nTextHeight*2 >
- aPageSize.Height() - nYIndent )
- {
- pAdaptor->EndPage();
- pAdaptor->StartPage();
- aOutPos.Y() = nYIndent;
- }
- pPrinter->DrawText(aOutPos, aTmp);
- aOutPos.Y() += pPrinter->GetTextHeight();
- }
- pStyle = pIter->Next();
- }
- pAdaptor->EndPage();
-
- Printer::PrintJob( pController, rPrt.GetJobSetup() );
-
- delete pIter;
- break;
- }
- default:
- return sal_False;
- }
- return sal_True;
-}
-
-//--------------------------------------------------------------------
-
void SfxObjectShell::LoadStyles
(
SfxObjectShell &rSource /* the document template from which
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 2d92b719ae67..b5fdbd9c85c6 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -83,7 +83,6 @@ class SfxActionListBox : public DropListBox_Impl
protected:
public:
SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinBits );
- SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, const ResId &rResId );
virtual PopupMenu* CreateContextMenu( void );
};
@@ -230,7 +229,6 @@ public:
TYPEINFO();
SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow* );
- SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* );
~SfxCommonTemplateDialog_Impl();
DECL_LINK( MenuSelectHdl, Menu * );
diff --git a/sfx2/uiconfig/ui/templatemanagementdialog.ui b/sfx2/uiconfig/ui/templatemanagementdialog.ui
deleted file mode 100644
index 10c48daaab31..000000000000
--- a/sfx2/uiconfig/ui/templatemanagementdialog.ui
+++ /dev/null
@@ -1,403 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<interface>
- <!-- interface-requires gtk+ 3.0 -->
- <object class="GtkDialog" id="TemplateManagementDialog">
- <property name="can_focus">False</property>
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Template Management</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="homogeneous">True</property>
- <property name="layout_style">start</property>
- <child>
- <object class="GtkButton" id="close">
- <property name="label">gtk-close</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="commands:commandmenu">
- <property name="label" translatable="yes">Commands</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="help">
- <property name="label">gtk-help</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="addressbook">
- <property name="label" translatable="yes">Address Book...</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="file">
- <property name="label">File...</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- <property name="secondary">True</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="spacing">12</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">12</property>
- <child>
- <object class="GtkComboBox" id="lefttype">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">liststore1</property>
- <property name="active">0</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="sfxlo:SfxOrganizeListBox" id="leftorganizer">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="foldercl">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">res/foldercl.png</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="docop">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">sfx2/res/doccl.png</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkGrid" id="grid2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="row_spacing">12</property>
- <child>
- <object class="GtkComboBox" id="righttype">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">liststore1</property>
- <property name="active">1</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="sfxlo:SfxOrganizeListBox" id="rightorganizer">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="doccl">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">sfx2/res/doccl.png</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkImage" id="folderop">
- <property name="can_focus">False</property>
- <property name="no_show_all">True</property>
- <property name="pixbuf">res/folderop.png</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">3</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">close</action-widget>
- <action-widget response="0">commands:commandmenu</action-widget>
- <action-widget response="0">help</action-widget>
- <action-widget response="0">addressbook</action-widget>
- <action-widget response="0">file</action-widget>
- </action-widgets>
- </object>
- <object class="GtkMenu" id="commandmenu">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkMenuItem" id="new">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_New</property>
- <property name="use_underline">True</property>
- <accelerator key="Insert" signal="activate"/>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="delete">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Delete</property>
- <property name="use_underline">True</property>
- <accelerator key="Delete" signal="activate"/>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="edit">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="menuitem4">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="copyfrom">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Import Template...</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="copyto">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Export Template...</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="menuitem7">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="print">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">_Print</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="printersetup">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Printer Settings</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="menuitem10">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="rescan">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Update</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkSeparatorMenuItem" id="menuitem12">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="defaulttemplate">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Set As Default Template</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- <child>
- <object class="GtkMenuItem" id="menuitem14">
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Reset Default Template</property>
- <property name="use_underline">True</property>
- </object>
- </child>
- </object>
- <object class="GtkListStore" id="liststore1">
- <columns>
- <!-- column-name gchararray1 -->
- <column type="gchararray"/>
- </columns>
- <data>
- <row>
- <col id="0" translatable="yes">Templates</col>
- </row>
- <row>
- <col id="0" translatable="yes">Documents</col>
- </row>
- </data>
- </object>
-</interface>