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
144d8243
Kaydet (Commit)
144d8243
authored
Tem 20, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
editeng: replace boost::ptr_map with std::map<std::unique_ptr>>
Change-Id: Id59fb4ee59872e60094bde85746416c83f058b00
üst
97a0e755
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
21 deletions
+23
-21
eertfpar.cxx
editeng/source/editeng/eertfpar.cxx
+6
-7
svxrtf.cxx
editeng/source/rtf/svxrtf.cxx
+11
-10
svxrtf.hxx
include/editeng/svxrtf.hxx
+6
-4
No files found.
editeng/source/editeng/eertfpar.cxx
Dosyayı görüntüle @
144d8243
...
@@ -368,7 +368,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
...
@@ -368,7 +368,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
DBG_ASSERT
(
it
!=
GetStyleTbl
().
end
(),
"Template not defined in RTF!"
);
DBG_ASSERT
(
it
!=
GetStyleTbl
().
end
(),
"Template not defined in RTF!"
);
if
(
it
!=
GetStyleTbl
().
end
()
)
if
(
it
!=
GetStyleTbl
().
end
()
)
{
{
SvxRTFStyleType
*
pS
=
it
->
second
;
auto
const
&
pS
=
it
->
second
;
mpEditEngine
->
SetStyleSheet
(
mpEditEngine
->
SetStyleSheet
(
EditSelection
(
aStartPaM
,
aEndPaM
),
EditSelection
(
aStartPaM
,
aEndPaM
),
static_cast
<
SfxStyleSheet
*>
(
mpEditEngine
->
GetStyleSheetPool
()
->
Find
(
pS
->
sName
,
SFX_STYLE_FAMILY_ALL
)));
static_cast
<
SfxStyleSheet
*>
(
mpEditEngine
->
GetStyleSheetPool
()
->
Find
(
pS
->
sName
,
SFX_STYLE_FAMILY_ALL
)));
...
@@ -433,11 +433,10 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
...
@@ -433,11 +433,10 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
SvxRTFStyleType
*
EditRTFParser
::
FindStyleSheet
(
const
OUString
&
rName
)
SvxRTFStyleType
*
EditRTFParser
::
FindStyleSheet
(
const
OUString
&
rName
)
{
{
SvxRTFStyleTbl
&
rTable
=
GetStyleTbl
();
SvxRTFStyleTbl
&
rTable
=
GetStyleTbl
();
for
(
SvxRTFStyleTbl
::
iterator
it
=
rTable
.
begin
();
it
!=
rTable
.
end
();
++
it
)
for
(
auto
const
&
iter
:
rTable
)
{
{
SvxRTFStyleType
*
pS
=
it
->
second
;
if
(
iter
.
second
->
sName
==
rName
)
if
(
pS
->
sName
==
rName
)
return
iter
.
second
.
get
();
return
pS
;
}
}
return
NULL
;
return
NULL
;
}
}
...
@@ -456,7 +455,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle )
...
@@ -456,7 +455,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle )
SvxRTFStyleTbl
::
iterator
it
=
GetStyleTbl
().
find
(
pRTFStyle
->
nBasedOn
);
SvxRTFStyleTbl
::
iterator
it
=
GetStyleTbl
().
find
(
pRTFStyle
->
nBasedOn
);
if
(
it
!=
GetStyleTbl
().
end
())
if
(
it
!=
GetStyleTbl
().
end
())
{
{
SvxRTFStyleType
*
pS
=
it
->
second
;
SvxRTFStyleType
*
const
pS
=
it
->
second
.
get
()
;
if
(
pS
&&
(
pS
!=
pRTFStyle
)
)
if
(
pS
&&
(
pS
!=
pRTFStyle
)
)
aParent
=
pS
->
sName
;
aParent
=
pS
->
sName
;
}
}
...
@@ -492,7 +491,7 @@ void EditRTFParser::CreateStyleSheets()
...
@@ -492,7 +491,7 @@ void EditRTFParser::CreateStyleSheets()
{
{
for
(
SvxRTFStyleTbl
::
iterator
it
=
GetStyleTbl
().
begin
();
it
!=
GetStyleTbl
().
end
();
++
it
)
for
(
SvxRTFStyleTbl
::
iterator
it
=
GetStyleTbl
().
begin
();
it
!=
GetStyleTbl
().
end
();
++
it
)
{
{
SvxRTFStyleType
*
pRTFStyle
=
it
->
second
;
SvxRTFStyleType
*
pRTFStyle
=
it
->
second
.
get
()
;
CreateStyleSheet
(
pRTFStyle
);
CreateStyleSheet
(
pRTFStyle
);
}
}
}
}
...
...
editeng/source/rtf/svxrtf.cxx
Dosyayı görüntüle @
144d8243
...
@@ -116,7 +116,7 @@ SvParserState SvxRTFParser::CallParser()
...
@@ -116,7 +116,7 @@ SvParserState SvxRTFParser::CallParser()
ClearColorTbl
();
ClearColorTbl
();
if
(
!
aFontTbl
.
empty
()
)
if
(
!
aFontTbl
.
empty
()
)
ClearFontTbl
();
ClearFontTbl
();
if
(
!
aStyleTbl
.
empty
()
)
if
(
!
m_StyleTable
.
empty
()
)
ClearStyleTbl
();
ClearStyleTbl
();
if
(
!
aAttrStack
.
empty
()
)
if
(
!
aAttrStack
.
empty
()
)
ClearAttrStack
();
ClearAttrStack
();
...
@@ -300,7 +300,8 @@ void SvxRTFParser::ReadStyleTable()
...
@@ -300,7 +300,8 @@ void SvxRTFParser::ReadStyleTable()
int
nToken
,
bSaveChkStyleAttr
=
bChkStyleAttr
?
1
:
0
;
int
nToken
,
bSaveChkStyleAttr
=
bChkStyleAttr
?
1
:
0
;
sal_uInt16
nStyleNo
=
0
;
sal_uInt16
nStyleNo
=
0
;
int
_nOpenBrakets
=
1
;
// the first was already detected earlier!!
int
_nOpenBrakets
=
1
;
// the first was already detected earlier!!
SvxRTFStyleType
*
pStyle
=
new
SvxRTFStyleType
(
*
pAttrPool
,
&
aWhichMap
[
0
]
);
::
std
::
unique_ptr
<
SvxRTFStyleType
>
pStyle
(
new
SvxRTFStyleType
(
*
pAttrPool
,
&
aWhichMap
[
0
]
));
pStyle
->
aAttrSet
.
Put
(
GetRTFDefaults
()
);
pStyle
->
aAttrSet
.
Put
(
GetRTFDefaults
()
);
bIsInReadStyleTab
=
true
;
bIsInReadStyleTab
=
true
;
...
@@ -348,13 +349,13 @@ void SvxRTFParser::ReadStyleTable()
...
@@ -348,13 +349,13 @@ void SvxRTFParser::ReadStyleTable()
{
{
pStyle
->
sName
=
DelCharAtEnd
(
aToken
,
';'
);
pStyle
->
sName
=
DelCharAtEnd
(
aToken
,
';'
);
if
(
!
aStyleTbl
.
empty
()
)
if
(
!
m_StyleTable
.
empty
()
)
{
{
aStyleTbl
.
erase
(
nStyleNo
);
m_StyleTable
.
erase
(
nStyleNo
);
}
}
// All data from the font is available, so off to the table
// All data from the font is available, so off to the table
aStyleTbl
.
insert
(
nStyleNo
,
pStyle
);
m_StyleTable
.
insert
(
std
::
make_pair
(
nStyleNo
,
std
::
move
(
pStyle
))
);
pStyle
=
new
SvxRTFStyleType
(
*
pAttrPool
,
&
aWhichMap
[
0
]
);
pStyle
.
reset
(
new
SvxRTFStyleType
(
*
pAttrPool
,
&
aWhichMap
[
0
]
)
);
pStyle
->
aAttrSet
.
Put
(
GetRTFDefaults
()
);
pStyle
->
aAttrSet
.
Put
(
GetRTFDefaults
()
);
nStyleNo
=
0
;
nStyleNo
=
0
;
}
}
...
@@ -386,7 +387,7 @@ void SvxRTFParser::ReadStyleTable()
...
@@ -386,7 +387,7 @@ void SvxRTFParser::ReadStyleTable()
break
;
break
;
}
}
}
}
delete
pStyle
;
// Delete the Last Style
pStyle
.
reset
();
// Delete the Last Style
SkipToken
(
-
1
);
// the closing brace is evaluated "above"
SkipToken
(
-
1
);
// the closing brace is evaluated "above"
// Flag back to old state
// Flag back to old state
...
@@ -764,7 +765,7 @@ void SvxRTFParser::ClearFontTbl()
...
@@ -764,7 +765,7 @@ void SvxRTFParser::ClearFontTbl()
void
SvxRTFParser
::
ClearStyleTbl
()
void
SvxRTFParser
::
ClearStyleTbl
()
{
{
aStyleTbl
.
clear
();
m_StyleTable
.
clear
();
}
}
void
SvxRTFParser
::
ClearAttrStack
()
void
SvxRTFParser
::
ClearAttrStack
()
...
@@ -835,7 +836,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
...
@@ -835,7 +836,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
if
(
!
IsChkStyleAttr
()
||
if
(
!
IsChkStyleAttr
()
||
!
rStkType
.
GetAttrSet
().
Count
()
||
!
rStkType
.
GetAttrSet
().
Count
()
||
aStyleTbl
.
count
(
rStkType
.
nStyleNo
)
==
0
)
m_StyleTable
.
count
(
rStkType
.
nStyleNo
)
==
0
)
{
{
for
(
sal_uInt16
nWhich
=
aIter
.
GetCurWhich
();
nWhich
;
nWhich
=
aIter
.
NextWhich
()
)
for
(
sal_uInt16
nWhich
=
aIter
.
GetCurWhich
();
nWhich
;
nWhich
=
aIter
.
NextWhich
()
)
{
{
...
@@ -849,7 +850,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
...
@@ -849,7 +850,7 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType )
{
{
// Delete all Attributes, which are already defined in the Style,
// Delete all Attributes, which are already defined in the Style,
// from the current AttrSet.
// from the current AttrSet.
SvxRTFStyleType
*
pStyle
=
aStyleTbl
.
find
(
rStkType
.
nStyleNo
)
->
second
;
auto
const
&
pStyle
=
m_StyleTable
.
find
(
rStkType
.
nStyleNo
)
->
second
;
SfxItemSet
&
rStyleSet
=
pStyle
->
aAttrSet
;
SfxItemSet
&
rStyleSet
=
pStyle
->
aAttrSet
;
const
SfxPoolItem
*
pSItem
;
const
SfxPoolItem
*
pSItem
;
for
(
sal_uInt16
nWhich
=
aIter
.
GetCurWhich
();
nWhich
;
nWhich
=
aIter
.
NextWhich
()
)
for
(
sal_uInt16
nWhich
=
aIter
.
GetCurWhich
();
nWhich
;
nWhich
=
aIter
.
NextWhich
()
)
...
...
include/editeng/svxrtf.hxx
Dosyayı görüntüle @
144d8243
...
@@ -27,8 +27,10 @@
...
@@ -27,8 +27,10 @@
#include <editeng/editengdllapi.h>
#include <editeng/editengdllapi.h>
#include <deque>
#include <deque>
#include <utility>
#include <vector>
#include <vector>
#include <map>
#include <utility>
#include <memory>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
...
@@ -78,7 +80,7 @@ public:
...
@@ -78,7 +80,7 @@ public:
typedef
std
::
deque
<
Color
*
>
SvxRTFColorTbl
;
typedef
std
::
deque
<
Color
*
>
SvxRTFColorTbl
;
typedef
boost
::
ptr_map
<
short
,
vcl
::
Font
>
SvxRTFFontTbl
;
typedef
boost
::
ptr_map
<
short
,
vcl
::
Font
>
SvxRTFFontTbl
;
typedef
boost
::
ptr_map
<
sal_uInt16
,
SvxRTFStyleType
>
SvxRTFStyleTbl
;
typedef
std
::
map
<
sal_uInt16
,
std
::
unique_ptr
<
SvxRTFStyleType
>
>
SvxRTFStyleTbl
;
// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackType* >" type, because
// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackType* >" type, because
// the methods are using operator[] in sw/source/filter/rtf/rtftbl.cxx file
// the methods are using operator[] in sw/source/filter/rtf/rtftbl.cxx file
...
@@ -177,7 +179,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
...
@@ -177,7 +179,7 @@ class EDITENG_DLLPUBLIC SvxRTFParser : public SvRTFParser
SvStream
&
rStrm
;
SvStream
&
rStrm
;
SvxRTFColorTbl
aColorTbl
;
SvxRTFColorTbl
aColorTbl
;
SvxRTFFontTbl
aFontTbl
;
SvxRTFFontTbl
aFontTbl
;
SvxRTFStyleTbl
aStyleTbl
;
SvxRTFStyleTbl
m_StyleTable
;
SvxRTFItemStack
aAttrStack
;
SvxRTFItemStack
aAttrStack
;
SvxRTFItemStackList
aAttrSetList
;
SvxRTFItemStackList
aAttrSetList
;
...
@@ -292,7 +294,7 @@ protected:
...
@@ -292,7 +294,7 @@ protected:
// Query/Set the current insert position
// Query/Set the current insert position
void
SetInsPos
(
const
SvxPosition
&
rNew
);
void
SetInsPos
(
const
SvxPosition
&
rNew
);
SvxRTFStyleTbl
&
GetStyleTbl
()
{
return
aStyleTbl
;
}
SvxRTFStyleTbl
&
GetStyleTbl
()
{
return
m_StyleTable
;
}
public
:
public
:
...
...
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