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
e4f956a3
Kaydet (Commit)
e4f956a3
authored
Şub 09, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Import all possible text format properties.
Change-Id: I4bbe93450d16a26e9b882041e0d21cf1c4140253
üst
7b42be6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
211 additions
and
24 deletions
+211
-24
editattributemap.cxx
sc/source/filter/xml/editattributemap.cxx
+49
-11
xmlcelli.cxx
sc/source/filter/xml/xmlcelli.cxx
+162
-13
No files found.
sc/source/filter/xml/editattributemap.cxx
Dosyayı görüntüle @
e4f956a3
...
...
@@ -16,19 +16,57 @@ namespace {
struct
{
const
char
*
mpXMLName
;
const
char
*
mpAPIName
;
sal_uInt16
mnItemID
;
sal_uInt8
mnFlag
;
}
Entries
[]
=
{
{
"color"
,
EE_CHAR_COLOR
,
0
},
{
"font-weight"
,
EE_CHAR_WEIGHT
,
MID_WEIGHT
},
{
"font-weight-asian"
,
EE_CHAR_WEIGHT_CJK
,
MID_WEIGHT
},
{
"font-weight-complex"
,
EE_CHAR_WEIGHT_CTL
,
MID_WEIGHT
},
{
"font-size"
,
EE_CHAR_FONTHEIGHT
,
MID_FONTHEIGHT
},
{
"font-size-asian"
,
EE_CHAR_FONTHEIGHT_CJK
,
MID_FONTHEIGHT
},
{
"font-size-complex"
,
EE_CHAR_FONTHEIGHT_CTL
,
MID_FONTHEIGHT
},
{
"font-style"
,
EE_CHAR_ITALIC
,
MID_POSTURE
},
{
"font-style-asian"
,
EE_CHAR_ITALIC_CJK
,
MID_POSTURE
},
{
"font-style-complex"
,
EE_CHAR_ITALIC_CTL
,
MID_POSTURE
},
{
"color"
,
"CharColor"
,
EE_CHAR_COLOR
,
0
},
{
"font-charset"
,
"CharFontCharSet"
,
EE_CHAR_FONTINFO
,
MID_FONT_CHAR_SET
},
{
"font-charset-asian"
,
"CharFontCharSetAsian"
,
EE_CHAR_FONTINFO_CJK
,
MID_FONT_CHAR_SET
},
{
"font-charset-complex"
,
"CharFontCharSetComplex"
,
EE_CHAR_FONTINFO_CTL
,
MID_FONT_CHAR_SET
},
{
"font-family"
,
"CharFontName"
,
EE_CHAR_FONTINFO
,
MID_FONT_FAMILY_NAME
},
{
"font-family-asian"
,
"CharFontNameAsian"
,
EE_CHAR_FONTINFO_CJK
,
MID_FONT_FAMILY_NAME
},
{
"font-family-complex"
,
"CharFontNameAsian"
,
EE_CHAR_FONTINFO_CTL
,
MID_FONT_FAMILY_NAME
},
{
"font-family-generic"
,
"CharFontFamily"
,
EE_CHAR_FONTINFO
,
MID_FONT_FAMILY
},
{
"font-family-generic-asian"
,
"CharFontFamilyAsian"
,
EE_CHAR_FONTINFO_CJK
,
MID_FONT_FAMILY
},
{
"font-family-generic-complex"
,
"CharFontFamilyComplex"
,
EE_CHAR_FONTINFO_CTL
,
MID_FONT_FAMILY
},
{
"font-pitch"
,
"CharFontPitch"
,
EE_CHAR_FONTINFO
,
MID_FONT_PITCH
},
{
"font-pitch-asian"
,
"CharFontPitchAsian"
,
EE_CHAR_FONTINFO_CJK
,
MID_FONT_PITCH
},
{
"font-pitch-complex"
,
"CharFontPitchComplex"
,
EE_CHAR_FONTINFO_CTL
,
MID_FONT_PITCH
},
{
"font-size"
,
"CharHeight"
,
EE_CHAR_FONTHEIGHT
,
MID_FONTHEIGHT
},
{
"font-size-asian"
,
"CharHeightAsian"
,
EE_CHAR_FONTHEIGHT_CJK
,
MID_FONTHEIGHT
},
{
"font-size-complex"
,
"CharHeightComplex"
,
EE_CHAR_FONTHEIGHT_CTL
,
MID_FONTHEIGHT
},
{
"font-style"
,
"CharPosture"
,
EE_CHAR_ITALIC
,
MID_POSTURE
},
{
"font-style-asian"
,
"CharPostureAsian"
,
EE_CHAR_ITALIC_CJK
,
MID_POSTURE
},
{
"font-style-complex"
,
"CharPostureComplex"
,
EE_CHAR_ITALIC_CTL
,
MID_POSTURE
},
{
"font-style-name"
,
"CharFontStyleName"
,
EE_CHAR_FONTINFO
,
MID_FONT_STYLE_NAME
},
{
"font-style-name-asian"
,
"CharFontStyleNameAsian"
,
EE_CHAR_FONTINFO_CJK
,
MID_FONT_STYLE_NAME
},
{
"font-style-name-complex"
,
"CharFontStyleNameComplex"
,
EE_CHAR_FONTINFO_CTL
,
MID_FONT_STYLE_NAME
},
{
"font-weight"
,
"CharWeight"
,
EE_CHAR_WEIGHT
,
MID_WEIGHT
},
{
"font-weight-asian"
,
"CharWeightAsian"
,
EE_CHAR_WEIGHT_CJK
,
MID_WEIGHT
},
{
"font-weight-complex"
,
"CharWeightComplex"
,
EE_CHAR_WEIGHT_CTL
,
MID_WEIGHT
},
{
"text-overline-width"
,
"CharOverline"
,
EE_CHAR_OVERLINE
,
MID_TL_STYLE
},
{
"text-overline-color"
,
"CharOverlineColor"
,
EE_CHAR_OVERLINE
,
MID_TL_COLOR
},
{
"text-overline-color"
,
"CharOverlineHasColor"
,
EE_CHAR_OVERLINE
,
MID_TL_HASCOLOR
},
{
"text-underline-width"
,
"CharUnderline"
,
EE_CHAR_UNDERLINE
,
MID_TL_STYLE
},
{
"text-underline-color"
,
"CharUnderlineColor"
,
EE_CHAR_UNDERLINE
,
MID_TL_COLOR
},
{
"text-underline-color"
,
"CharUnderlineHasColor"
,
EE_CHAR_UNDERLINE
,
MID_TL_HASCOLOR
},
{
"text-line-through-mode"
,
"CharWordMode"
,
EE_CHAR_WLM
,
0
},
{
"text-line-through-type"
,
"CharStrikeout"
,
EE_CHAR_STRIKEOUT
,
MID_CROSS_OUT
},
{
"font-relief"
,
"CharRelief"
,
EE_CHAR_RELIEF
,
MID_RELIEF
},
{
"text-outline"
,
"CharContoured"
,
EE_CHAR_OUTLINE
,
0
},
{
"text-shadow"
,
"CharShadowed"
,
EE_CHAR_SHADOW
,
0
},
{
"letter-spacing"
,
"CharKerning"
,
EE_CHAR_KERNING
,
0
},
{
"letter-kerning"
,
"CharAutoKerning"
,
EE_CHAR_PAIRKERNING
,
0
},
{
"text-scale"
,
"CharScaleWidth"
,
EE_CHAR_FONTWIDTH
,
0
},
{
"text-position"
,
"CharEscapement"
,
EE_CHAR_ESCAPEMENT
,
MID_ESC
},
{
"text-position"
,
"CharEscapementHeight"
,
EE_CHAR_ESCAPEMENT
,
MID_ESC_HEIGHT
},
{
"text-emphasize"
,
"CharEmphasis"
,
EE_CHAR_EMPHASISMARK
,
MID_EMPHASIS
},
{
"country"
,
"CharLocale"
,
EE_CHAR_LANGUAGE
,
MID_LANG_LOCALE
},
{
"country-asian"
,
"CharLocaleAsian"
,
EE_CHAR_LANGUAGE_CJK
,
MID_LANG_LOCALE
},
{
"country-complex"
,
"CharLocaleComplex"
,
EE_CHAR_LANGUAGE_CTL
,
MID_LANG_LOCALE
},
};
}
...
...
@@ -43,7 +81,7 @@ ScXMLEditAttributeMap::ScXMLEditAttributeMap()
{
maEntries
.
insert
(
EntriesType
::
value_type
(
OUString
::
createFromAscii
(
Entries
[
i
].
mp
XML
Name
),
OUString
::
createFromAscii
(
Entries
[
i
].
mp
API
Name
),
Entry
(
Entries
[
i
].
mnItemID
,
Entries
[
i
].
mnFlag
)));
}
}
...
...
sc/source/filter/xml/xmlcelli.cxx
Dosyayı görüntüle @
e4f956a3
...
...
@@ -65,6 +65,19 @@
#include "editeng/colritem.hxx"
#include "editeng/fhgtitem.hxx"
#include "editeng/postitem.hxx"
#include "editeng/fontitem.hxx"
#include "editeng/udlnitem.hxx"
#include "editeng/wrlmitem.hxx"
#include "editeng/crsditem.hxx"
#include "editeng/charreliefitem.hxx"
#include "editeng/charscaleitem.hxx"
#include "editeng/cntritem.hxx"
#include "editeng/shdditem.hxx"
#include "editeng/kernitem.hxx"
#include "editeng/akrnitem.hxx"
#include "editeng/escpitem.hxx"
#include "editeng/emphitem.hxx"
#include "editeng/langitem.hxx"
#include <svx/unoapi.hxx>
#include <svl/languageoptions.hxx>
#include <sax/tools/converter.hxx>
...
...
@@ -348,57 +361,193 @@ void ScXMLTableRowCellContext::PushParagraphSpan(const OUString& rSpan, const OU
rFmt
.
maSelection
.
nStartPos
=
nBegin
;
rFmt
.
maSelection
.
nEndPos
=
nEnd
;
boost
::
scoped_ptr
<
SfxPoolItem
>
pPoolItem
;
sal_uInt16
nLastItemID
=
EE_CHAR_END
+
1
;
std
::
vector
<
XMLPropertyState
>::
const_iterator
it
=
rProps
.
begin
(),
itEnd
=
rProps
.
end
();
for
(;
it
!=
itEnd
;
++
it
)
{
if
(
it
->
mnIndex
==
-
1
||
it
->
mnIndex
>=
nEntryCount
)
continue
;
const
OUString
&
rName
=
xMapper
->
GetEntry
XML
Name
(
it
->
mnIndex
);
const
OUString
&
rName
=
xMapper
->
GetEntry
API
Name
(
it
->
mnIndex
);
const
ScXMLEditAttributeMap
::
Entry
*
pEntry
=
rEditAttrMap
.
getEntry
(
rName
);
if
(
!
pEntry
)
continue
;
if
(
nLastItemID
!=
pEntry
->
mnItemID
&&
pPoolItem
)
{
// Flush the last item when the item ID changes.
rFmt
.
maItemSet
.
Put
(
*
pPoolItem
);
pPoolItem
.
reset
();
}
switch
(
pEntry
->
mnItemID
)
{
case
EE_CHAR_FONTINFO
:
case
EE_CHAR_FONTINFO_CJK
:
case
EE_CHAR_FONTINFO_CTL
:
{
// Font properties need to be consolidated into a single item.
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxFontItem
(
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_WEIGHT
:
case
EE_CHAR_WEIGHT_CJK
:
case
EE_CHAR_WEIGHT_CTL
:
{
SvxWeightItem
aItem
(
WEIGHT_NORMAL
,
pEntry
->
mnItemID
);
aItem
.
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
rFmt
.
maItemSet
.
Put
(
aItem
);
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxWeightItem
(
WEIGHT_NORMAL
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_FONTHEIGHT
:
case
EE_CHAR_FONTHEIGHT_CJK
:
case
EE_CHAR_FONTHEIGHT_CTL
:
{
SvxFontHeightItem
aItem
(
240
,
100
,
pEntry
->
mnItemID
);
aItem
.
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
rFmt
.
maItemSet
.
Put
(
aItem
);
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxFontHeightItem
(
240
,
100
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_ITALIC
:
case
EE_CHAR_ITALIC_CJK
:
case
EE_CHAR_ITALIC_CTL
:
{
SvxPostureItem
aItem
(
ITALIC_NONE
,
pEntry
->
mnItemID
);
aItem
.
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
rFmt
.
maItemSet
.
Put
(
aItem
);
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxPostureItem
(
ITALIC_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_UNDERLINE
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxUnderlineItem
(
UNDERLINE_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_OVERLINE
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxOverlineItem
(
UNDERLINE_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_COLOR
:
{
SvxColorItem
aItem
(
pEntry
->
mnItemID
);
aItem
.
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
rFmt
.
maItemSet
.
Put
(
aItem
);
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxColorItem
(
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_WLM
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxWordLineModeItem
(
false
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_STRIKEOUT
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxCrossedOutItem
(
STRIKEOUT_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_RELIEF
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxCharReliefItem
(
RELIEF_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_OUTLINE
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxContourItem
(
false
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_SHADOW
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxShadowedItem
(
false
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_KERNING
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxKerningItem
(
0
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_PAIRKERNING
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxAutoKernItem
(
false
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_FONTWIDTH
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxCharScaleWidthItem
(
100
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_ESCAPEMENT
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxEscapementItem
(
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_EMPHASISMARK
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxEmphasisMarkItem
(
EMPHASISMARK_NONE
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
case
EE_CHAR_LANGUAGE
:
case
EE_CHAR_LANGUAGE_CJK
:
case
EE_CHAR_LANGUAGE_CTL
:
{
if
(
!
pPoolItem
)
pPoolItem
.
reset
(
new
SvxLanguageItem
(
LANGUAGE_DONTKNOW
,
pEntry
->
mnItemID
));
pPoolItem
->
PutValue
(
it
->
maValue
,
pEntry
->
mnFlag
);
}
break
;
default
:
;
}
nLastItemID
=
pEntry
->
mnItemID
;
}
if
(
pPoolItem
)
rFmt
.
maItemSet
.
Put
(
*
pPoolItem
);
}
void
ScXMLTableRowCellContext
::
PushParagraphEnd
()
...
...
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