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
24578b80
Kaydet (Commit)
24578b80
authored
Ock 17, 2013
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
rhbz#760765 copy custom styles on copy & paste
Change-Id: Icaacf3bc1a02a017692432aec36aba06d3f5dde5
üst
34add900
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
9 deletions
+77
-9
stlpool.hxx
sd/inc/stlpool.hxx
+3
-0
drawdoc3.cxx
sd/source/core/drawdoc3.cxx
+46
-3
stlpool.cxx
sd/source/core/stlpool.cxx
+18
-0
stlsheet.cxx
sd/source/core/stlsheet.cxx
+10
-6
No files found.
sd/inc/stlpool.hxx
Dosyayı görüntüle @
24578b80
...
@@ -80,6 +80,8 @@ public:
...
@@ -80,6 +80,8 @@ public:
void
CopyGraphicSheets
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyGraphicSheets
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyCellSheets
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyCellSheets
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyTableStyles
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyTableStyles
(
SdStyleSheetPool
&
rSourcePool
);
void
CopyGraphicSheets
(
SdStyleSheetPool
&
rSourcePool
,
SdStyleSheetVector
&
rCreatedSheets
);
void
CopyCellSheets
(
SdStyleSheetPool
&
rSourcePool
,
SdStyleSheetVector
&
rCreatedSheets
);
void
CreatePseudosIfNecessary
();
void
CreatePseudosIfNecessary
();
void
UpdateStdNames
();
void
UpdateStdNames
();
...
@@ -121,6 +123,7 @@ public:
...
@@ -121,6 +123,7 @@ public:
virtual
void
SAL_CALL
release
(
void
)
throw
();
virtual
void
SAL_CALL
release
(
void
)
throw
();
protected
:
protected
:
void
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
);
void
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
);
void
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
,
SdStyleSheetVector
&
rCreatedSheets
);
virtual
SfxStyleSheetBase
*
Create
(
const
String
&
rName
,
SfxStyleFamily
eFamily
,
sal_uInt16
nMask
);
virtual
SfxStyleSheetBase
*
Create
(
const
String
&
rName
,
SfxStyleFamily
eFamily
,
sal_uInt16
nMask
);
virtual
SfxStyleSheetBase
*
Create
(
const
SdStyleSheet
&
rStyle
);
virtual
SfxStyleSheetBase
*
Create
(
const
SdStyleSheet
&
rStyle
);
...
...
sd/source/core/drawdoc3.cxx
Dosyayı görüntüle @
24578b80
...
@@ -357,6 +357,26 @@ sal_Bool SdDrawDocument::InsertBookmark(
...
@@ -357,6 +357,26 @@ sal_Bool SdDrawDocument::InsertBookmark(
return
bOK
;
return
bOK
;
}
}
namespace
{
void
lcl_removeUnusedStyles
(
SfxStyleSheetBasePool
*
const
pStyleSheetPool
,
SdStyleSheetVector
&
rStyles
)
{
SdStyleSheetVector
aUsedStyles
;
aUsedStyles
.
reserve
(
rStyles
.
size
());
for
(
SdStyleSheetVector
::
const_iterator
aIt
(
rStyles
.
begin
()),
aLast
(
rStyles
.
end
());
aIt
!=
aLast
;
++
aIt
)
{
if
((
*
aIt
)
->
IsUsed
())
aUsedStyles
.
push_back
(
*
aIt
);
else
pStyleSheetPool
->
Remove
((
*
aIt
).
get
());
}
rStyles
=
aUsedStyles
;
}
}
sal_Bool
SdDrawDocument
::
InsertBookmarkAsPage
(
sal_Bool
SdDrawDocument
::
InsertBookmarkAsPage
(
const
std
::
vector
<
rtl
::
OUString
>
&
rBookmarkList
,
const
std
::
vector
<
rtl
::
OUString
>
&
rBookmarkList
,
std
::
vector
<
rtl
::
OUString
>
*
pExchangeList
,
// Liste der zu verwendenen Namen
std
::
vector
<
rtl
::
OUString
>
*
pExchangeList
,
// Liste der zu verwendenen Namen
...
@@ -484,8 +504,8 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
...
@@ -484,8 +504,8 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
/**************************************************************************
/**************************************************************************
* Die tatsaechlich benoetigten Vorlagen kopieren
* Die tatsaechlich benoetigten Vorlagen kopieren
**************************************************************************/
**************************************************************************/
SdStyleSheetPool
*
pBookmarkStyleSheetPool
=
SdStyleSheetPool
*
pBookmarkStyleSheetPool
=
dynamic_cast
<
SdStyleSheetPool
*>
(
pBookmarkDoc
->
GetStyleSheetPool
());
(
SdStyleSheetPool
*
)
pBookmarkDoc
->
GetStyleSheetPool
(
);
SdStyleSheetPool
*
pStyleSheetPool
=
dynamic_cast
<
SdStyleSheetPool
*>
(
GetStyleSheetPool
()
);
// Wenn Vorlagen kopiert werden muessen, dann muessen auch die
// Wenn Vorlagen kopiert werden muessen, dann muessen auch die
// MasterPages kopiert werden!
// MasterPages kopiert werden!
...
@@ -498,7 +518,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
...
@@ -498,7 +518,7 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
SdStyleSheetVector
aCreatedStyles
;
SdStyleSheetVector
aCreatedStyles
;
String
layoutName
=
*
pIter
;
String
layoutName
=
*
pIter
;
((
SdStyleSheetPool
*
)
GetStyleSheetPool
())
->
CopyLayoutSheets
(
layoutName
,
*
pBookmarkStyleSheetPool
,
aCreatedStyles
);
pStyleSheetPool
->
CopyLayoutSheets
(
layoutName
,
*
pBookmarkStyleSheetPool
,
aCreatedStyles
);
if
(
!
aCreatedStyles
.
empty
())
if
(
!
aCreatedStyles
.
empty
())
{
{
...
@@ -510,6 +530,18 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
...
@@ -510,6 +530,18 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
}
}
}
}
// Copy styles. This unconditionally copies all styles, even those
// that are not used in any of the inserted pages. The unused styles
// are then removed at the end of the function, where we also create
// undo records for the inserted styles.
SdStyleSheetVector
aNewGraphicStyles
;
pStyleSheetPool
->
CopyGraphicSheets
(
*
pBookmarkStyleSheetPool
,
aNewGraphicStyles
);
SdStyleSheetVector
aNewCellStyles
;
pStyleSheetPool
->
CopyCellSheets
(
*
pBookmarkStyleSheetPool
,
aNewCellStyles
);
// TODO handle undo of table styles too
pStyleSheetPool
->
CopyTableStyles
(
*
pBookmarkStyleSheetPool
);
/**************************************************************************
/**************************************************************************
* Dokument einfuegen
* Dokument einfuegen
**************************************************************************/
**************************************************************************/
...
@@ -910,6 +942,17 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
...
@@ -910,6 +942,17 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
// Make absolutely sure no double masterpages are there
// Make absolutely sure no double masterpages are there
RemoveUnnecessaryMasterPages
(
NULL
,
sal_True
,
sal_True
);
RemoveUnnecessaryMasterPages
(
NULL
,
sal_True
,
sal_True
);
// remove copied styles not used on any inserted page and create
// undo records
// WARNING: SdMoveStyleSheetsUndoAction clears the passed list of
// styles, so it cannot be used after this point
lcl_removeUnusedStyles
(
GetStyleSheetPool
(),
aNewGraphicStyles
);
if
(
!
aNewGraphicStyles
.
empty
()
&&
pUndoMgr
)
pUndoMgr
->
AddUndoAction
(
new
SdMoveStyleSheetsUndoAction
(
this
,
aNewGraphicStyles
,
sal_True
));
lcl_removeUnusedStyles
(
GetStyleSheetPool
(),
aNewCellStyles
);
if
(
!
aNewCellStyles
.
empty
()
&&
pUndoMgr
)
pUndoMgr
->
AddUndoAction
(
new
SdMoveStyleSheetsUndoAction
(
this
,
aNewCellStyles
,
sal_True
));
if
(
bUndo
)
if
(
bUndo
)
EndUndo
();
EndUndo
();
pUndoMgr
->
LeaveListAction
();
pUndoMgr
->
LeaveListAction
();
...
...
sd/source/core/stlpool.cxx
Dosyayı görüntüle @
24578b80
...
@@ -582,7 +582,23 @@ void SdStyleSheetPool::CopyTableStyles(SdStyleSheetPool& rSourcePool)
...
@@ -582,7 +582,23 @@ void SdStyleSheetPool::CopyTableStyles(SdStyleSheetPool& rSourcePool)
}
}
}
}
void
SdStyleSheetPool
::
CopyGraphicSheets
(
SdStyleSheetPool
&
rSourcePool
,
SdStyleSheetVector
&
rCreatedSheets
)
{
CopySheets
(
rSourcePool
,
SD_STYLE_FAMILY_GRAPHICS
,
rCreatedSheets
);
}
void
SdStyleSheetPool
::
CopyCellSheets
(
SdStyleSheetPool
&
rSourcePool
,
SdStyleSheetVector
&
rCreatedSheets
)
{
CopySheets
(
rSourcePool
,
SD_STYLE_FAMILY_CELL
,
rCreatedSheets
);
}
void
SdStyleSheetPool
::
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
)
void
SdStyleSheetPool
::
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
)
{
SdStyleSheetVector
aTmpSheets
;
CopySheets
(
rSourcePool
,
eFamily
,
aTmpSheets
);
}
void
SdStyleSheetPool
::
CopySheets
(
SdStyleSheetPool
&
rSourcePool
,
SfxStyleFamily
eFamily
,
SdStyleSheetVector
&
rCreatedSheets
)
{
{
String
aHelpFile
;
String
aHelpFile
;
...
@@ -610,6 +626,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
...
@@ -610,6 +626,8 @@ void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily
xNewSheet
->
SetHelpId
(
aHelpFile
,
xSheet
->
GetHelpId
(
aHelpFile
)
);
xNewSheet
->
SetHelpId
(
aHelpFile
,
xSheet
->
GetHelpId
(
aHelpFile
)
);
xNewSheet
->
GetItemSet
().
Put
(
xSheet
->
GetItemSet
()
);
xNewSheet
->
GetItemSet
().
Put
(
xSheet
->
GetItemSet
()
);
rCreatedSheets
.
push_back
(
SdStyleSheetRef
(
static_cast
<
SdStyleSheet
*
>
(
xNewSheet
.
get
()
)
)
);
}
}
}
}
}
}
...
...
sd/source/core/stlsheet.cxx
Dosyayı görüntüle @
24578b80
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include <svl/smplhint.hxx>
#include <svl/smplhint.hxx>
#include <svl/itemset.hxx>
#include <svl/itemset.hxx>
#include <svx/sdr/properties/attributeproperties.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflbstit.hxx>
#include <svx/xflbstit.hxx>
#include <editeng/bulitem.hxx>
#include <editeng/bulitem.hxx>
...
@@ -349,13 +350,16 @@ bool SdStyleSheet::IsUsed() const
...
@@ -349,13 +350,16 @@ bool SdStyleSheet::IsUsed() const
continue
;
continue
;
// NULL-Pointer ist im Listener-Array erlaubt
// NULL-Pointer ist im Listener-Array erlaubt
if
(
pListener
&&
pListener
->
ISA
(
SdrAttrObj
)
)
if
(
pListener
)
{
{
bResult
=
((
SdrAttrObj
*
)
pListener
)
->
IsInserted
();
if
(
pListener
->
ISA
(
sdr
::
properties
::
AttributeProperties
))
}
{
else
if
(
pListener
&&
pListener
->
ISA
(
SfxStyleSheet
))
bResult
=
true
;
{
}
bResult
=
((
SfxStyleSheet
*
)
pListener
)
->
IsUsed
();
else
if
(
pListener
->
ISA
(
SfxStyleSheet
))
{
bResult
=
((
SfxStyleSheet
*
)
pListener
)
->
IsUsed
();
}
}
}
if
(
bResult
)
if
(
bResult
)
break
;
break
;
...
...
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