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
d2726959
Kaydet (Commit)
d2726959
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: Ia6fce8eceb364d83cbbf5abcf734be262614e792
üst
144d8243
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
27 deletions
+18
-27
svxrtf.cxx
editeng/source/rtf/svxrtf.cxx
+15
-18
svxrtf.hxx
include/editeng/svxrtf.hxx
+3
-9
No files found.
editeng/source/rtf/svxrtf.cxx
Dosyayı görüntüle @
d2726959
...
...
@@ -114,7 +114,7 @@ SvParserState SvxRTFParser::CallParser()
if
(
!
aColorTbl
.
empty
()
)
ClearColorTbl
();
if
(
!
aFontTbl
.
empty
()
)
if
(
!
m_FontTable
.
empty
()
)
ClearFontTbl
();
if
(
!
m_StyleTable
.
empty
())
ClearStyleTbl
();
...
...
@@ -159,7 +159,7 @@ void SvxRTFParser::NextToken( int nToken )
case
RTF_DEFF
:
if
(
bNewDoc
)
{
if
(
!
aFontTbl
.
empty
()
)
if
(
!
m_FontTable
.
empty
()
)
// Can immediately be set
SetDefault
(
nToken
,
nTokenValue
);
else
...
...
@@ -442,7 +442,7 @@ void SvxRTFParser::ReadFontTable()
{
int
nToken
=
0
;
int
_nOpenBrakets
=
1
;
// the first was already detected earlier!!
vcl
::
Font
*
pFont
=
new
vcl
::
Font
(
);
std
::
unique_ptr
<
vcl
::
Font
>
pFont
(
new
vcl
::
Font
);
short
nFontNo
(
0
),
nInsFontNo
(
0
);
OUString
sAltNm
,
sFntNm
;
bool
bIsAltFntNm
=
false
;
...
...
@@ -558,15 +558,15 @@ void SvxRTFParser::ReadFontTable()
sFntNm
=
sFntNm
+
";"
+
sAltNm
;
pFont
->
SetName
(
sFntNm
);
aFontTbl
.
insert
(
nInsFontNo
,
pFont
);
pFont
=
new
vcl
::
Font
(
);
m_FontTable
.
insert
(
std
::
make_pair
(
nInsFontNo
,
std
::
move
(
pFont
))
);
pFont
.
reset
(
new
vcl
::
Font
);
pFont
->
SetCharSet
(
nSystemChar
);
sAltNm
.
clear
();
sFntNm
.
clear
();
}
}
// the last one we have to delete manually
delete
pFont
;
pFont
.
reset
()
;
SkipToken
(
-
1
);
// the closing brace is evaluated "above"
// set the default font in the Document
...
...
@@ -760,7 +760,7 @@ void SvxRTFParser::ClearColorTbl()
void
SvxRTFParser
::
ClearFontTbl
()
{
aFontTbl
.
clear
();
m_FontTable
.
clear
();
}
void
SvxRTFParser
::
ClearStyleTbl
()
...
...
@@ -793,19 +793,16 @@ OUString& SvxRTFParser::DelCharAtEnd( OUString& rStr, const sal_Unicode cDel )
const
vcl
::
Font
&
SvxRTFParser
::
GetFont
(
sal_uInt16
nId
)
{
SvxRTFFontTbl
::
const_iterator
it
=
aFontTbl
.
find
(
nId
);
const
vcl
::
Font
*
pFont
;
if
(
it
==
aFontTbl
.
end
()
)
SvxRTFFontTbl
::
const_iterator
it
=
m_FontTable
.
find
(
nId
);
if
(
it
!=
m_FontTable
.
end
())
{
const
SvxFontItem
&
rDfltFont
=
static_cast
<
const
SvxFontItem
&>
(
pAttrPool
->
GetDefaultItem
(
aPlainMap
.
nFont
));
pDfltFont
->
SetName
(
rDfltFont
.
GetStyleName
()
);
pDfltFont
->
SetFamily
(
rDfltFont
.
GetFamily
()
);
pFont
=
pDfltFont
;
return
*
it
->
second
;
}
else
pFont
=
it
->
second
;
return
*
pFont
;
const
SvxFontItem
&
rDfltFont
=
static_cast
<
const
SvxFontItem
&>
(
pAttrPool
->
GetDefaultItem
(
aPlainMap
.
nFont
));
pDfltFont
->
SetName
(
rDfltFont
.
GetStyleName
()
);
pDfltFont
->
SetFamily
(
rDfltFont
.
GetFamily
()
);
return
*
pDfltFont
;
}
SvxRTFItemStackType
*
SvxRTFParser
::
_GetAttrSet
(
bool
const
bCopyAttr
)
...
...
include/editeng/svxrtf.hxx
Dosyayı görüntüle @
d2726959
...
...
@@ -31,7 +31,6 @@
#include <map>
#include <utility>
#include <memory>
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
namespace
vcl
{
class
Font
;
}
...
...
@@ -79,7 +78,7 @@ public:
typedef
std
::
deque
<
Color
*
>
SvxRTFColorTbl
;
typedef
boost
::
ptr_map
<
short
,
vcl
::
Font
>
SvxRTFFontTbl
;
typedef
std
::
map
<
short
,
std
::
unique_ptr
<
vcl
::
Font
>
>
SvxRTFFontTbl
;
typedef
std
::
map
<
sal_uInt16
,
std
::
unique_ptr
<
SvxRTFStyleType
>>
SvxRTFStyleTbl
;
// SvxRTFItemStack can't be "std::stack< SvxRTFItemStackType* >" type, because
...
...
@@ -170,15 +169,11 @@ struct RTFPardAttrMapIds
};
class
EDITENG_DLLPUBLIC
SvxRTFParser
:
public
SvRTFParser
{
SvStream
&
rStrm
;
SvxRTFColorTbl
aColorTbl
;
SvxRTFFontTbl
aFontTbl
;
SvxRTFFontTbl
m_FontTable
;
SvxRTFStyleTbl
m_StyleTable
;
SvxRTFItemStack
aAttrStack
;
SvxRTFItemStackList
aAttrSetList
;
...
...
@@ -389,7 +384,6 @@ inline SfxItemSet& SvxRTFParser::GetAttrSet()
}
#endif
// INCLUDED_EDITENG_SVXRTF_HXX
#endif // INCLUDED_EDITENG_SVXRTF_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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