Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
aca63abb
Kaydet (Commit)
aca63abb
authored
Agu 08, 2012
tarafından
Rafael Dominguez
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Implement setting a template as default.
Change-Id: I8ae47ffb38febdd467e1e557448189dd09e755bc
üst
07090cac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
0 deletions
+62
-0
templatedlg.hxx
sfx2/inc/templatedlg.hxx
+1
-0
templatedlg.cxx
sfx2/source/doc/templatedlg.cxx
+54
-0
templatedlg.hrc
sfx2/source/doc/templatedlg.hrc
+1
-0
templatedlg.src
sfx2/source/doc/templatedlg.src
+6
-0
No files found.
sfx2/inc/templatedlg.hxx
Dosyayı görüntüle @
aca63abb
...
...
@@ -75,6 +75,7 @@ private:
void
OnTemplateEdit
();
void
OnTemplateProperties
();
void
OnTemplateDelete
();
void
OnTemplateAsDefault
();
void
OnFolderDelete
();
void
OnRepositoryDelete
();
...
...
sfx2/source/doc/templatedlg.cxx
Dosyayı görüntüle @
aca63abb
...
...
@@ -14,6 +14,10 @@
#include "templatesearchviewitem.hxx"
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <sfx2/app.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/fcontnr.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/sfxresid.hxx>
#include <sfx2/templatelocalview.hxx>
...
...
@@ -22,6 +26,7 @@
#include <sfx2/templateonlineviewitem.hxx>
#include <sfx2/templateviewitem.hxx>
#include <sfx2/thumbnailviewitem.hxx>
#include <sot/storage.hxx>
#include <svtools/PlaceEditDialog.hxx>
#include <tools/urlobj.hxx>
#include <unotools/moduleoptions.hxx>
...
...
@@ -30,6 +35,8 @@
#include <vcl/toolbox.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/lang/XComponent.hpp>
...
...
@@ -54,10 +61,13 @@
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
embed
;
using
namespace
::
com
::
sun
::
star
::
frame
;
void
lcl_createTemplate
(
uno
::
Reference
<
XComponentLoader
>
xDesktop
,
const
FILTER_APPLICATION
eApp
);
bool
lcl_getServiceName
(
const
OUString
&
rFileURL
,
OUString
&
rName
);
// Sort by name in ascending order
class
SortView_Name
{
...
...
@@ -379,6 +389,9 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,TBXTemplateHdl)
case
TBI_TEMPLATE_DELETE
:
OnTemplateDelete
();
break
;
case
TBI_TEMPLATE_DEFAULT
:
OnTemplateAsDefault
();
break
;
default
:
break
;
}
...
...
@@ -855,6 +868,19 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
}
}
void
SfxTemplateManagerDlg
::
OnTemplateAsDefault
()
{
assert
(
!
maSelTemplates
.
empty
());
const
TemplateViewItem
*
pItem
=
static_cast
<
const
TemplateViewItem
*>
(
*
(
maSelTemplates
.
begin
()));
OUString
aServiceName
;
if
(
lcl_getServiceName
(
pItem
->
getPath
(),
aServiceName
))
{
SfxObjectFactory
::
SetStandardTemplate
(
aServiceName
,
pItem
->
getPath
());
}
}
void
SfxTemplateManagerDlg
::
OnFolderDelete
()
{
std
::
set
<
const
ThumbnailViewItem
*>::
const_iterator
pIter
;
...
...
@@ -1073,4 +1099,32 @@ void SfxTemplateManagerDlg::localSearchMoveTo(sal_uInt16 nMenuId)
SearchUpdateHdl
(
mpSearchEdit
);
}
bool
lcl_getServiceName
(
const
OUString
&
rFileURL
,
OUString
&
rName
)
{
bool
bRet
=
false
;
if
(
!
rFileURL
.
isEmpty
()
)
{
try
{
uno
::
Reference
<
embed
::
XStorage
>
xStorage
=
comphelper
::
OStorageHelper
::
GetStorageFromURL
(
rFileURL
,
embed
::
ElementModes
::
READ
);
sal_uIntPtr
nFormat
=
SotStorage
::
GetFormatID
(
xStorage
);
const
SfxFilter
*
pFilter
=
SFX_APP
()
->
GetFilterMatcher
().
GetFilter4ClipBoardId
(
nFormat
);
if
(
pFilter
)
{
rName
=
pFilter
->
GetServiceName
();
bRet
=
true
;
}
}
catch
(
uno
::
Exception
&
)
{}
}
return
bRet
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sfx2/source/doc/templatedlg.hrc
Dosyayı görüntüle @
aca63abb
...
...
@@ -27,6 +27,7 @@
#define TBI_TEMPLATE_PROPERTIES 16
#define TBI_TEMPLATE_MOVE 17
#define TBI_TEMPLATE_DELETE 18
#define TBI_TEMPLATE_DEFAULT 19
#define MNI_ACTION_REFRESH 22
#define MNI_ACTION_SORT_NAME 23
...
...
sfx2/source/doc/templatedlg.src
Dosyayı görüntüle @
aca63abb
...
...
@@ -225,6 +225,12 @@ ModelessDialog DLG_TEMPLATE_MANAGER
Text [ en-US ] = "Properties";
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_DEFAULT;
Text [ en-US ] = "Set as default";
};
ToolBoxItem
{
Identifier = TBI_TEMPLATE_MOVE;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment