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
b156d957
Kaydet (Commit)
b156d957
authored
Ock 05, 2011
tarafından
Daniel Rentz [dr]
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
dr78: #i96587# import text formatting from OOXML and BIFF12
üst
c15fb917
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
49 deletions
+49
-49
richstring.hxx
oox/inc/oox/xls/richstring.hxx
+2
-5
commentsbuffer.cxx
oox/source/xls/commentsbuffer.cxx
+22
-22
richstring.cxx
oox/source/xls/richstring.cxx
+25
-22
No files found.
oox/inc/oox/xls/richstring.hxx
Dosyayı görüntüle @
b156d957
...
...
@@ -74,7 +74,7 @@ public:
/** Converts the portion and appends it to the passed XText. */
void
convert
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
text
::
XText
>&
rxText
,
sal_Int32
nXfId
);
sal_Int32
nXfId
,
bool
bReplaceOld
=
false
);
private
:
::
rtl
::
OUString
maText
;
/// Portion text.
...
...
@@ -254,13 +254,10 @@ public:
/** Final processing after import of all strings. */
void
finalizeImport
();
/** Returns the plain text concatenated from all string portions. */
::
rtl
::
OUString
getPlainText
()
const
;
/** Converts the string and writes it into the passed XText. */
void
convert
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
text
::
XText
>&
rxText
,
sal_Int32
nXfId
)
const
;
sal_Int32
nXfId
,
bool
bReplaceOld
=
false
)
const
;
private
:
/** Creates, appends, and returns a new empty string portion. */
...
...
oox/source/xls/commentsbuffer.cxx
Dosyayı görüntüle @
b156d957
...
...
@@ -48,6 +48,7 @@ using ::com::sun::star::sheet::XSheetAnnotationAnchor;
using
::
com
::
sun
::
star
::
sheet
::
XSheetAnnotationShapeSupplier
;
using
::
com
::
sun
::
star
::
sheet
::
XSheetAnnotations
;
using
::
com
::
sun
::
star
::
sheet
::
XSheetAnnotationsSupplier
;
using
::
com
::
sun
::
star
::
text
::
XText
;
namespace
oox
{
namespace
xls
{
...
...
@@ -96,30 +97,29 @@ void Comment::finalizeImport()
CellAddress
aNotePos
(
maModel
.
maRange
.
Sheet
,
maModel
.
maRange
.
StartColumn
,
maModel
.
maRange
.
StartRow
);
if
(
getAddressConverter
().
checkCellAddress
(
aNotePos
,
true
)
&&
maModel
.
mxText
.
get
()
)
try
{
maModel
.
mxText
->
finalizeImport
();
OUString
aNoteText
=
maModel
.
mxText
->
getPlainText
();
// non-empty string required by note implementation
if
(
aNoteText
.
getLength
()
>
0
)
Reference
<
XSheetAnnotationsSupplier
>
xAnnosSupp
(
getSheet
(),
UNO_QUERY_THROW
);
Reference
<
XSheetAnnotations
>
xAnnos
(
xAnnosSupp
->
getAnnotations
(),
UNO_SET_THROW
);
// non-empty string required by note implementation (real text will be added below)
xAnnos
->
insertNew
(
aNotePos
,
OUString
(
sal_Unicode
(
' '
)
)
);
// receive craeted note from cell (insertNew does not return the note)
Reference
<
XSheetAnnotationAnchor
>
xAnnoAnchor
(
getCell
(
aNotePos
),
UNO_QUERY_THROW
);
Reference
<
XSheetAnnotation
>
xAnno
(
xAnnoAnchor
->
getAnnotation
(),
UNO_SET_THROW
);
Reference
<
XSheetAnnotationShapeSupplier
>
xAnnoShapeSupp
(
xAnno
,
UNO_QUERY_THROW
);
Reference
<
XShape
>
xAnnoShape
(
xAnnoShapeSupp
->
getAnnotationShape
(),
UNO_SET_THROW
);
// convert shape formatting
if
(
const
::
oox
::
vml
::
ShapeBase
*
pNoteShape
=
getVmlDrawing
().
getNoteShape
(
aNotePos
)
)
{
Reference
<
XSheetAnnotationsSupplier
>
xAnnosSupp
(
getSheet
(),
UNO_QUERY_THROW
);
Reference
<
XSheetAnnotations
>
xAnnos
(
xAnnosSupp
->
getAnnotations
(),
UNO_SET_THROW
);
xAnnos
->
insertNew
(
aNotePos
,
aNoteText
);
// receive craeted note from cell (insertNew does not return the note)
Reference
<
XSheetAnnotationAnchor
>
xAnnoAnchor
(
getCell
(
aNotePos
),
UNO_QUERY_THROW
);
Reference
<
XSheetAnnotation
>
xAnno
(
xAnnoAnchor
->
getAnnotation
(),
UNO_SET_THROW
);
Reference
<
XSheetAnnotationShapeSupplier
>
xAnnoShapeSupp
(
xAnno
,
UNO_QUERY_THROW
);
Reference
<
XShape
>
xAnnoShape
(
xAnnoShapeSupp
->
getAnnotationShape
(),
UNO_SET_THROW
);
// convert shape formatting
if
(
const
::
oox
::
vml
::
ShapeBase
*
pNoteShape
=
getVmlDrawing
().
getNoteShape
(
aNotePos
)
)
{
// position and formatting
pNoteShape
->
convertFormatting
(
xAnnoShape
);
// visibility
const
::
oox
::
vml
::
ShapeModel
::
ShapeClientDataPtr
&
rxClientData
=
pNoteShape
->
getShapeModel
().
mxClientData
;
bool
bVisible
=
rxClientData
.
get
()
&&
rxClientData
->
mbVisible
;
xAnno
->
setIsVisible
(
bVisible
);
}
// position and formatting
pNoteShape
->
convertFormatting
(
xAnnoShape
);
// visibility
const
::
oox
::
vml
::
ShapeModel
::
ShapeClientDataPtr
&
rxClientData
=
pNoteShape
->
getShapeModel
().
mxClientData
;
bool
bVisible
=
rxClientData
.
get
()
&&
rxClientData
->
mbVisible
;
xAnno
->
setIsVisible
(
bVisible
);
}
// insert text and convert text formatting
maModel
.
mxText
->
finalizeImport
();
Reference
<
XText
>
xAnnoText
(
xAnnoShape
,
UNO_QUERY_THROW
);
maModel
.
mxText
->
convert
(
xAnnoText
,
-
1
,
true
);
}
catch
(
Exception
&
)
{
...
...
oox/source/xls/richstring.cxx
Dosyayı görüntüle @
b156d957
...
...
@@ -37,6 +37,7 @@ using ::rtl::OString;
using
::
rtl
::
OUString
;
using
::
rtl
::
OUStringBuffer
;
using
::
com
::
sun
::
star
::
uno
::
Reference
;
using
::
com
::
sun
::
star
::
uno
::
UNO_QUERY
;
using
::
com
::
sun
::
star
::
text
::
XText
;
using
::
com
::
sun
::
star
::
text
::
XTextRange
;
...
...
@@ -84,21 +85,30 @@ void RichStringPortion::finalizeImport()
mxFont
=
getStyles
().
getFont
(
mnFontId
);
}
void
RichStringPortion
::
convert
(
const
Reference
<
XText
>&
rxText
,
sal_Int32
nXfId
)
void
RichStringPortion
::
convert
(
const
Reference
<
XText
>&
rxText
,
sal_Int32
nXfId
,
bool
bReplaceOld
)
{
Reference
<
XTextRange
>
xRange
=
rxText
->
getEnd
()
;
xRange
->
setString
(
maText
);
if
(
mxFont
.
get
()
)
{
PropertySet
aPropSet
(
xRange
);
mxFont
->
writeToPropertySet
(
aPropSet
,
FONT_PROPTYPE_TEXT
);
}
if
(
const
Font
*
pFont
=
getStyles
().
getFontFromCellXf
(
nXfId
).
get
()
)
Reference
<
XTextRange
>
xRange
;
if
(
bReplaceOld
)
xRange
.
set
(
rxText
,
UNO_QUERY
);
else
xRange
=
rxText
->
getEnd
(
);
OSL_ENSURE
(
xRange
.
is
(),
"RichStringPortion::convert - cannot get text range interface"
);
if
(
xRange
.
is
()
)
{
if
(
pFont
->
needsRichTextFormat
()
)
xRange
->
setString
(
maText
);
if
(
mxFont
.
get
()
)
{
PropertySet
aPropSet
(
xRange
);
pFont
->
writeToPropertySet
(
aPropSet
,
FONT_PROPTYPE_TEXT
);
mxFont
->
writeToPropertySet
(
aPropSet
,
FONT_PROPTYPE_TEXT
);
}
if
(
const
Font
*
pFont
=
getStyles
().
getFontFromCellXf
(
nXfId
).
get
()
)
{
if
(
pFont
->
needsRichTextFormat
()
)
{
PropertySet
aPropSet
(
xRange
);
pFont
->
writeToPropertySet
(
aPropSet
,
FONT_PROPTYPE_TEXT
);
}
}
}
}
...
...
@@ -489,20 +499,13 @@ void RichString::finalizeImport()
maFontPortions
.
forEachMem
(
&
RichStringPortion
::
finalizeImport
);
}
OUString
RichString
::
getPlainText
()
const
{
OUStringBuffer
aBuffer
;
for
(
PortionVec
::
const_iterator
aIt
=
maFontPortions
.
begin
(),
aEnd
=
maFontPortions
.
end
();
aIt
!=
aEnd
;
++
aIt
)
aBuffer
.
append
(
(
*
aIt
)
->
getText
()
);
return
aBuffer
.
makeStringAndClear
();
}
void
RichString
::
convert
(
const
Reference
<
XText
>&
rxText
,
sal_Int32
nXfId
)
const
void
RichString
::
convert
(
const
Reference
<
XText
>&
rxText
,
sal_Int32
nXfId
,
bool
bReplaceOld
)
const
{
for
(
PortionVec
::
const_iterator
aIt
=
maFontPortions
.
begin
(),
aEnd
=
maFontPortions
.
end
();
aIt
!=
aEnd
;
++
aIt
)
{
(
*
aIt
)
->
convert
(
rxText
,
nXfId
);
nXfId
=
-
1
;
// use passed XF identifier for first portion only
(
*
aIt
)
->
convert
(
rxText
,
nXfId
,
bReplaceOld
);
nXfId
=
-
1
;
// use passed XF identifier for first portion only
bReplaceOld
=
false
;
// do not replace first portion text with following portions
}
}
...
...
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