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
03fe839d
Kaydet (Commit)
03fe839d
authored
Eyl 20, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
html export: rework image output to use HTML writer
Change-Id: Iead3f0f49b93453bd45f07f047978cb92d279d21
üst
3aa99295
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
413 additions
and
165 deletions
+413
-165
htmlflywriter.cxx
sw/source/filter/html/htmlflywriter.cxx
+370
-135
wrthtml.cxx
sw/source/filter/html/wrthtml.cxx
+36
-30
wrthtml.hxx
sw/source/filter/html/wrthtml.hxx
+7
-0
No files found.
sw/source/filter/html/htmlflywriter.cxx
Dosyayı görüntüle @
03fe839d
...
@@ -803,115 +803,360 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt,
...
@@ -803,115 +803,360 @@ OString SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt,
return
sRetEndTags
;
return
sRetEndTags
;
}
}
Writer
&
OutHTML_Image
(
Writer
&
rWrt
,
const
SwFrmFmt
&
rFrmFmt
,
void
SwHTMLWriter
::
writeFrameFormatOptions
(
HtmlWriter
&
aHtml
,
const
SwFrmFmt
&
rFrmFmt
,
const
OUString
&
rAlternateText
,
sal_uInt32
nFrameOptions
)
Graphic
&
rGraphic
,
const
OUString
&
rAlternateTxt
,
const
Size
&
rRealSize
,
sal_uInt32
nFrmOpts
,
const
sal_Char
*
pMarkType
,
const
ImageMap
*
pAltImgMap
)
{
{
SwHTMLWriter
&
rHTMLWrt
=
static_cast
<
SwHTMLWriter
&>
(
rWrt
)
;
OStringBuffer
sOut
;
if
(
rHTMLWrt
.
mbSkipImages
)
const
SfxPoolItem
*
pItem
;
return
rHTMLWrt
;
const
SfxItemSet
&
rItemSet
=
rFrmFmt
.
GetAttrSet
()
;
// ggf. ein noch offenes Attribut voruebergehend beenden
// Name
if
(
!
rHTMLWrt
.
aINetFmts
.
empty
()
)
if
(
(
nFrameOptions
&
(
HTML_FRMOPT_ID
|
HTML_FRMOPT_NAME
))
&&
!
rFrmFmt
.
GetName
().
isEmpty
()
)
{
{
SwFmtINetFmt
*
pINetFmt
=
rHTMLWrt
.
aINetFmts
.
back
()
;
const
sal_Char
*
pAttributeName
=
(
nFrameOptions
&
HTML_FRMOPT_ID
)
?
OOO_STRING_SVTOOLS_HTML_O_id
:
OOO_STRING_SVTOOLS_HTML_O_name
;
OutHTML_INetFmt
(
rWrt
,
*
pINetFmt
,
false
);
aHtml
.
attribute
(
pAttributeName
,
rFrmFmt
.
GetName
()
);
}
}
const
SfxPoolItem
*
pItem
;
// Name
const
SfxItemSet
&
rItemSet
=
rFrmFmt
.
GetAttrSet
();
if
(
nFrameOptions
&
HTML_FRMOPT_DIR
)
{
sal_uInt16
nCurrentDirection
=
GetHTMLDirection
(
rItemSet
);
OString
sDirection
=
convertDirection
(
nCurrentDirection
);
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_dir
,
sDirection
);
}
const
SwFmtURL
*
pURLItem
=
0
;
// alt
if
(
(
nFrameOptions
&
HTML_FRMOPT_ALT
)
&&
!
rAlternateText
.
isEmpty
()
)
{
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_alt
,
rAlternateText
);
}
// align
const
sal_Char
*
pAlignString
=
0
;
RndStdIds
eAnchorId
=
rFrmFmt
.
GetAnchor
().
GetAnchorId
();
if
(
(
nFrameOptions
&
HTML_FRMOPT_ALIGN
)
&&
((
FLY_AT_PARA
==
eAnchorId
)
||
(
FLY_AT_CHAR
==
eAnchorId
))
)
{
const
SwFmtHoriOrient
&
rHoriOri
=
rFrmFmt
.
GetHoriOrient
();
if
(
!
(
nFrameOptions
&
HTML_FRMOPT_S_ALIGN
)
||
text
::
RelOrientation
::
FRAME
==
rHoriOri
.
GetRelationOrient
()
||
text
::
RelOrientation
::
PRINT_AREA
==
rHoriOri
.
GetRelationOrient
()
)
{
pAlignString
=
text
::
HoriOrientation
::
RIGHT
==
rHoriOri
.
GetHoriOrient
()
?
OOO_STRING_SVTOOLS_HTML_AL_right
:
OOO_STRING_SVTOOLS_HTML_AL_left
;
}
}
if
(
(
nFrameOptions
&
HTML_FRMOPT_ALIGN
)
&&
!
pAlignString
&&
(
(
nFrameOptions
&
HTML_FRMOPT_S_ALIGN
)
==
0
||
(
FLY_AS_CHAR
==
eAnchorId
)
)
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_VERT_ORIENT
,
true
,
&
pItem
))
{
switch
(
((
SwFmtVertOrient
*
)
pItem
)
->
GetVertOrient
()
)
{
case
text
:
:
VertOrientation
::
LINE_TOP
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_top
;
break
;
case
text
:
:
VertOrientation
::
CHAR_TOP
:
case
text
:
:
VertOrientation
::
BOTTOM
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_texttop
;
break
;
case
text
:
:
VertOrientation
::
LINE_CENTER
:
case
text
:
:
VertOrientation
::
CHAR_CENTER
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_absmiddle
;
break
;
case
text
:
:
VertOrientation
::
CENTER
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_middle
;
break
;
case
text
:
:
VertOrientation
::
LINE_BOTTOM
:
case
text
:
:
VertOrientation
::
CHAR_BOTTOM
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_absbottom
;
break
;
case
text
:
:
VertOrientation
::
TOP
:
pAlignString
=
OOO_STRING_SVTOOLS_HTML_VA_bottom
;
break
;
case
text
:
:
VertOrientation
::
NONE
:
break
;
}
}
if
(
pAlignString
)
{
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_align
,
pAlignString
);
}
// hspace und vspace
Size
aTwipSpc
(
0
,
0
);
if
(
(
nFrameOptions
&
(
HTML_FRMOPT_SPACE
|
HTML_FRMOPT_MARGINSIZE
))
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_LR_SPACE
,
true
,
&
pItem
))
{
aTwipSpc
.
Width
()
=
(
((
SvxLRSpaceItem
*
)
pItem
)
->
GetLeft
()
+
((
SvxLRSpaceItem
*
)
pItem
)
->
GetRight
()
)
/
2
;
nDfltLeftMargin
=
nDfltRightMargin
=
aTwipSpc
.
Width
();
}
if
(
(
nFrameOptions
&
(
HTML_FRMOPT_SPACE
|
HTML_FRMOPT_MARGINSIZE
))
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_UL_SPACE
,
true
,
&
pItem
))
{
aTwipSpc
.
Height
()
=
(
((
SvxULSpaceItem
*
)
pItem
)
->
GetUpper
()
+
((
SvxULSpaceItem
*
)
pItem
)
->
GetLower
()
)
/
2
;
nDfltTopMargin
=
nDfltBottomMargin
=
(
sal_uInt16
)
aTwipSpc
.
Height
();
}
if
(
(
nFrameOptions
&
HTML_FRMOPT_SPACE
)
&&
(
aTwipSpc
.
Width
()
||
aTwipSpc
.
Height
())
&&
Application
::
GetDefaultDevice
()
)
{
Size
aPixelSpc
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
aTwipSpc
,
MapMode
(
MAP_TWIP
)
);
if
(
!
aPixelSpc
.
Width
()
&&
aTwipSpc
.
Width
()
)
aPixelSpc
.
Width
()
=
1
;
if
(
!
aPixelSpc
.
Height
()
&&
aTwipSpc
.
Height
()
)
aPixelSpc
.
Height
()
=
1
;
if
(
aPixelSpc
.
Width
())
{
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_hspace
,
static_cast
<
sal_Int32
>
(
aPixelSpc
.
Width
()));
}
if
(
aPixelSpc
.
Height
())
{
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_vspace
,
static_cast
<
sal_Int32
>
(
aPixelSpc
.
Height
()));
}
}
// Der Abstand muss bei der Groesse beruecksichtigt, wenn das entsprechende
// Flag gesetzt ist.
if
(
(
nFrameOptions
&
HTML_FRMOPT_MARGINSIZE
)
)
{
aTwipSpc
.
Width
()
*=
-
2
;
aTwipSpc
.
Height
()
*=
-
2
;
}
else
{
aTwipSpc
.
Width
()
=
0
;
aTwipSpc
.
Height
()
=
0
;
}
if
(
!
(
nFrameOptions
&
HTML_FRMOPT_ABSSIZE
)
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_BOX
,
true
,
&
pItem
))
{
const
SvxBoxItem
*
pBoxItem
=
(
const
SvxBoxItem
*
)
pItem
;
aTwipSpc
.
Width
()
+=
pBoxItem
->
CalcLineSpace
(
BOX_LINE_LEFT
);
aTwipSpc
.
Width
()
+=
pBoxItem
->
CalcLineSpace
(
BOX_LINE_RIGHT
);
aTwipSpc
.
Height
()
+=
pBoxItem
->
CalcLineSpace
(
BOX_LINE_TOP
);
aTwipSpc
.
Height
()
+=
pBoxItem
->
CalcLineSpace
(
BOX_LINE_BOTTOM
);
}
// "width" and/or "height"
// ATT_VAR_SIZE/ATT_MIN_SIZE nur ausgeben, wenn ANYSIZE gesezut ist
if
(
(
nFrameOptions
&
HTML_FRMOPT_SIZE
)
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_FRM_SIZE
,
true
,
&
pItem
)
&&
(
(
nFrameOptions
&
HTML_FRMOPT_ANYSIZE
)
||
ATT_FIX_SIZE
==
((
const
SwFmtFrmSize
*
)
pItem
)
->
GetHeightSizeType
())
)
{
const
SwFmtFrmSize
*
pFSItem
=
(
const
SwFmtFrmSize
*
)
pItem
;
sal_uInt8
nPrcWidth
=
pFSItem
->
GetWidthPercent
();
sal_uInt8
nPrcHeight
=
pFSItem
->
GetHeightPercent
();
// Groesse des Objekts Twips ohne Raender
Size
aTwipSz
(
(
nPrcWidth
?
0
:
pFSItem
->
GetWidth
()
-
aTwipSpc
.
Width
()),
(
nPrcHeight
?
0
:
pFSItem
->
GetHeight
()
-
aTwipSpc
.
Height
())
);
OSL_ENSURE
(
aTwipSz
.
Width
()
>=
0
&&
aTwipSz
.
Height
()
>=
0
,
"Rahmengroesse minus Abstand < 0!!!???"
);
if
(
aTwipSz
.
Width
()
<
0
)
aTwipSz
.
Width
()
=
0
;
if
(
aTwipSz
.
Height
()
<
0
)
aTwipSz
.
Height
()
=
0
;
Size
aPixelSz
(
0
,
0
);
if
(
(
aTwipSz
.
Width
()
||
aTwipSz
.
Height
())
&&
Application
::
GetDefaultDevice
()
)
{
aPixelSz
=
Application
::
GetDefaultDevice
()
->
LogicToPixel
(
aTwipSz
,
MapMode
(
MAP_TWIP
)
);
if
(
!
aPixelSz
.
Width
()
&&
aTwipSz
.
Width
()
)
aPixelSz
.
Width
()
=
1
;
if
(
!
aPixelSz
.
Height
()
&&
aTwipSz
.
Height
()
)
aPixelSz
.
Height
()
=
1
;
}
if
(
(
nFrameOptions
&
HTML_FRMOPT_WIDTH
)
&&
((
nPrcWidth
&&
nPrcWidth
!=
255
)
||
aPixelSz
.
Width
())
)
{
OString
sWidth
;
if
(
nPrcWidth
)
sWidth
=
OString
::
number
(
static_cast
<
sal_Int32
>
(
nPrcWidth
))
+
"%"
;
else
sWidth
=
OString
::
number
(
static_cast
<
sal_Int32
>
(
aPixelSz
.
Width
()));
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_width
,
sWidth
);
}
if
(
(
nFrameOptions
&
HTML_FRMOPT_HEIGHT
)
&&
((
nPrcHeight
&&
nPrcHeight
!=
255
)
||
aPixelSz
.
Height
())
)
{
OString
sHeight
;
if
(
nPrcWidth
)
sHeight
=
OString
::
number
(
static_cast
<
sal_Int32
>
(
nPrcHeight
))
+
"%"
;
else
sHeight
=
OString
::
number
(
static_cast
<
sal_Int32
>
(
aPixelSz
.
Height
()));
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_height
,
sHeight
);
}
}
// Umlauf fuer absatzgeb. Grafiken als <BR CLEAR=...> in den String
// schreiben
const
sal_Char
*
pSurroundString
=
0
;
if
(
(
nFrameOptions
&
HTML_FRMOPT_BRCLEAR
)
&&
((
FLY_AT_PARA
==
rFrmFmt
.
GetAnchor
().
GetAnchorId
())
||
(
FLY_AT_CHAR
==
rFrmFmt
.
GetAnchor
().
GetAnchorId
()))
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_SURROUND
,
true
,
&
pItem
))
{
const
SwFmtSurround
*
pSurround
=
(
const
SwFmtSurround
*
)
pItem
;
sal_Int16
eHoriOri
=
rFrmFmt
.
GetHoriOrient
().
GetHoriOrient
();
SwSurround
eSurround
=
pSurround
->
GetSurround
();
bool
bAnchorOnly
=
pSurround
->
IsAnchorOnly
();
switch
(
eHoriOri
)
{
case
text
:
:
HoriOrientation
::
RIGHT
:
{
switch
(
eSurround
)
{
case
SURROUND_NONE
:
case
SURROUND_RIGHT
:
pSurroundString
=
OOO_STRING_SVTOOLS_HTML_AL_right
;
break
;
case
SURROUND_LEFT
:
case
SURROUND_PARALLEL
:
if
(
bAnchorOnly
)
bClearRight
=
true
;
break
;
default
:
;
}
}
break
;
default
:
// If a frame is centered, it gets left aligned. This
// should be taken into account here, too.
{
switch
(
eSurround
)
{
case
SURROUND_NONE
:
case
SURROUND_LEFT
:
pSurroundString
=
OOO_STRING_SVTOOLS_HTML_AL_left
;
break
;
case
SURROUND_RIGHT
:
case
SURROUND_PARALLEL
:
if
(
bAnchorOnly
)
bClearLeft
=
true
;
break
;
default
:
break
;
}
}
break
;
}
if
(
pSurroundString
)
{
aHtml
.
start
(
OOO_STRING_SVTOOLS_HTML_linebreak
);
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_clear
,
pSurroundString
);
aHtml
.
end
();
}
}
}
namespace
{
OUString
lclWriteOutImap
(
SwHTMLWriter
&
rHTMLWrt
,
const
SfxItemSet
&
rItemSet
,
const
SwFrmFmt
&
rFrmFmt
,
const
Size
&
rRealSize
,
const
ImageMap
*
pAltImgMap
,
SwFmtURL
*&
pURLItem
)
{
OUString
aIMapName
;
const
SfxPoolItem
*
pItem
;
// das URL-Attribut nur beruecksichtigen, wenn keine Image-Map
// das URL-Attribut nur beruecksichtigen, wenn keine Image-Map
// uebergeben wurde
// uebergeben wurde
if
(
!
pAltImgMap
&&
if
(
!
pAltImgMap
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_URL
,
true
,
&
pItem
))
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_URL
,
true
,
&
pItem
))
{
{
pURLItem
=
(
const
SwFmtURL
*
)
pItem
;
pURLItem
=
(
SwFmtURL
*
)
pItem
;
}
}
// Image-Map rausschreiben
// Image-Map rausschreiben
const
ImageMap
*
pIMap
=
pAltImgMap
;
const
ImageMap
*
pIMap
=
pAltImgMap
;
if
(
!
pIMap
&&
pURLItem
)
if
(
!
pIMap
&&
pURLItem
)
{
{
pIMap
=
pURLItem
->
GetMap
();
pIMap
=
pURLItem
->
GetMap
();
}
}
OUString
aIMapName
;
if
(
pIMap
)
if
(
pIMap
)
{
{
// den Namen eindeutig machen
// den Namen eindeutig machen
aIMapName
=
pIMap
->
GetName
();
aIMapName
=
pIMap
->
GetName
();
OUString
aNameBase
;
OUString
aNameBase
;
if
(
!
aIMapName
.
isEmpty
()
)
if
(
!
aIMapName
.
isEmpty
()
)
aNameBase
=
aIMapName
;
aNameBase
=
aIMapName
;
else
else
aNameBase
=
OOO_STRING_SVTOOLS_HTML_map
;
aNameBase
=
OOO_STRING_SVTOOLS_HTML_map
;
if
(
aIMapName
.
isEmpty
()
)
aIMapName
=
aNameBase
+
OUString
::
number
(
rHTMLWrt
.
nImgMapCnt
);
if
(
aIMapName
.
isEmpty
())
aIMapName
=
aNameBase
+
OUString
::
number
(
rHTMLWrt
.
nImgMapCnt
);
bool
bFound
;
bool
bFound
;
do
do
{
{
bFound
=
false
;
bFound
=
false
;
for
(
size_t
i
=
0
;
i
<
rHTMLWrt
.
aImgMapNames
.
size
();
++
i
)
for
(
size_t
i
=
0
;
i
<
rHTMLWrt
.
aImgMapNames
.
size
();
++
i
)
{
{
// TODO: Unicode: Comparison is case insensitive for ASCII
// TODO: Unicode: Comparison is case insensitive for ASCII
// characters only now!
// characters only now!
if
(
aIMapName
.
equalsIgnoreAsciiCase
(
rHTMLWrt
.
aImgMapNames
[
i
]
)
)
if
(
aIMapName
.
equalsIgnoreAsciiCase
(
rHTMLWrt
.
aImgMapNames
[
i
])
)
{
{
bFound
=
true
;
bFound
=
true
;
break
;
break
;
}
}
}
}
if
(
bFound
)
if
(
bFound
)
{
{
rHTMLWrt
.
nImgMapCnt
++
;
rHTMLWrt
.
nImgMapCnt
++
;
aIMapName
=
aNameBase
+
OUString
::
number
(
rHTMLWrt
.
nImgMapCnt
);
aIMapName
=
aNameBase
+
OUString
::
number
(
rHTMLWrt
.
nImgMapCnt
);
}
}
}
while
(
bFound
);
}
while
(
bFound
);
bool
bScale
=
false
;
bool
bScale
=
false
;
Fraction
aScaleX
(
1
,
1
);
Fraction
aScaleX
(
1
,
1
);
Fraction
aScaleY
(
1
,
1
);
Fraction
aScaleY
(
1
,
1
);
const
SwFmtFrmSize
&
rFrmSize
=
rFrmFmt
.
GetFrmSize
();
const
SwFmtFrmSize
&
rFrmSize
=
rFrmFmt
.
GetFrmSize
();
const
SvxBoxItem
&
rBox
=
rFrmFmt
.
GetBox
();
const
SvxBoxItem
&
rBox
=
rFrmFmt
.
GetBox
();
if
(
!
rFrmSize
.
GetWidthPercent
()
&&
rRealSize
.
Width
()
)
if
(
!
rFrmSize
.
GetWidthPercent
()
&&
rRealSize
.
Width
()
)
{
{
SwTwips
nWidth
=
rFrmSize
.
GetWidth
();
SwTwips
nWidth
=
rFrmSize
.
GetWidth
();
nWidth
-=
(
rBox
.
CalcLineSpace
(
BOX_LINE_LEFT
)
+
nWidth
-=
rBox
.
CalcLineSpace
(
BOX_LINE_LEFT
)
+
rBox
.
CalcLineSpace
(
BOX_LINE_RIGHT
);
rBox
.
CalcLineSpace
(
BOX_LINE_RIGHT
)
);
OSL_ENSURE
(
nWidth
>
0
,
"Gibt es 0 twip breite Grafiken!?"
);
OSL_ENSURE
(
nWidth
>
0
,
"Gibt es 0 twip breite Grafiken!?"
);
if
(
nWidth
<=
0
)
// sollte nicht passieren
if
(
nWidth
<=
0
)
// sollte nicht passieren
nWidth
=
1
;
nWidth
=
1
;
if
(
rRealSize
.
Width
()
!=
nWidth
)
if
(
rRealSize
.
Width
()
!=
nWidth
)
{
{
aScaleX
=
Fraction
(
nWidth
,
rRealSize
.
Width
()
);
aScaleX
=
Fraction
(
nWidth
,
rRealSize
.
Width
()
);
bScale
=
true
;
bScale
=
true
;
}
}
}
}
if
(
!
rFrmSize
.
GetHeightPercent
()
&&
rRealSize
.
Height
()
)
if
(
!
rFrmSize
.
GetHeightPercent
()
&&
rRealSize
.
Height
())
{
{
SwTwips
nHeight
=
rFrmSize
.
GetHeight
();
SwTwips
nHeight
=
rFrmSize
.
GetHeight
();
nHeight
-=
(
rBox
.
CalcLineSpace
(
BOX_LINE_TOP
)
+
rBox
.
CalcLineSpace
(
BOX_LINE_BOTTOM
)
);
OSL_ENSURE
(
nHeight
>
0
,
"Gibt es 0 twip hohe Grafiken!?"
);
nHeight
-=
rBox
.
CalcLineSpace
(
BOX_LINE_TOP
)
+
rBox
.
CalcLineSpace
(
BOX_LINE_BOTTOM
);
if
(
nHeight
<=
0
)
OSL_ENSURE
(
nHeight
>
0
,
"Gibt es 0 twip hohe Grafiken!?"
);
if
(
nHeight
<=
0
)
nHeight
=
1
;
nHeight
=
1
;
if
(
rRealSize
.
Height
()
!=
nHeight
)
if
(
rRealSize
.
Height
()
!=
nHeight
)
{
{
aScaleY
=
Fraction
(
nHeight
,
rRealSize
.
Height
()
);
aScaleY
=
Fraction
(
nHeight
,
rRealSize
.
Height
()
);
bScale
=
true
;
bScale
=
true
;
}
}
}
}
...
@@ -921,7 +1166,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
...
@@ -921,7 +1166,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
OString
aIndMap
,
aIndArea
;
OString
aIndMap
,
aIndArea
;
const
sal_Char
*
pIndArea
=
0
,
*
pIndMap
=
0
;
const
sal_Char
*
pIndArea
=
0
,
*
pIndMap
=
0
;
if
(
rHTMLWrt
.
bLFPossible
)
if
(
rHTMLWrt
.
bLFPossible
)
{
{
rHTMLWrt
.
OutNewLine
(
true
);
rHTMLWrt
.
OutNewLine
(
true
);
aIndMap
=
rHTMLWrt
.
GetIndentString
();
aIndMap
=
rHTMLWrt
.
GetIndentString
();
...
@@ -930,11 +1175,11 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
...
@@ -930,11 +1175,11 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
pIndMap
=
aIndMap
.
getStr
();
pIndMap
=
aIndMap
.
getStr
();
}
}
if
(
bScale
)
if
(
bScale
)
{
{
ImageMap
aScaledIMap
(
*
pIMap
);
ImageMap
aScaledIMap
(
*
pIMap
);
aScaledIMap
.
Scale
(
aScaleX
,
aScaleY
);
aScaledIMap
.
Scale
(
aScaleX
,
aScaleY
);
HTMLOutFuncs
::
Out_ImageMap
(
r
Wrt
.
Strm
(),
r
Wrt
.
GetBaseURL
(),
aScaledIMap
,
aIMapName
,
HTMLOutFuncs
::
Out_ImageMap
(
r
HTMLWrt
.
Strm
(),
rHTML
Wrt
.
GetBaseURL
(),
aScaledIMap
,
aIMapName
,
aIMapEventTable
,
aIMapEventTable
,
rHTMLWrt
.
bCfgStarBasic
,
rHTMLWrt
.
bCfgStarBasic
,
SAL_NEWLINE_STRING
,
pIndArea
,
pIndMap
,
SAL_NEWLINE_STRING
,
pIndArea
,
pIndMap
,
...
@@ -943,7 +1188,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
...
@@ -943,7 +1188,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
}
}
else
else
{
{
HTMLOutFuncs
::
Out_ImageMap
(
r
Wrt
.
Strm
(),
r
Wrt
.
GetBaseURL
(),
*
pIMap
,
aIMapName
,
HTMLOutFuncs
::
Out_ImageMap
(
r
HTMLWrt
.
Strm
(),
rHTML
Wrt
.
GetBaseURL
(),
*
pIMap
,
aIMapName
,
aIMapEventTable
,
aIMapEventTable
,
rHTMLWrt
.
bCfgStarBasic
,
rHTMLWrt
.
bCfgStarBasic
,
SAL_NEWLINE_STRING
,
pIndArea
,
pIndMap
,
SAL_NEWLINE_STRING
,
pIndArea
,
pIndMap
,
...
@@ -951,94 +1196,101 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
...
@@ -951,94 +1196,101 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
&
rHTMLWrt
.
aNonConvertableCharacters
);
&
rHTMLWrt
.
aNonConvertableCharacters
);
}
}
}
}
return
aIMapName
;
}
// wenn meoglich vor der Grafik einen Zeilen-Umbruch ausgeben
}
Writer
&
OutHTML_Image
(
Writer
&
rWrt
,
const
SwFrmFmt
&
rFrmFmt
,
Graphic
&
rGraphic
,
const
OUString
&
rAlternateTxt
,
const
Size
&
rRealSize
,
sal_uInt32
nFrmOpts
,
const
sal_Char
*
pMarkType
,
const
ImageMap
*
pAltImgMap
)
{
SwHTMLWriter
&
rHTMLWrt
=
static_cast
<
SwHTMLWriter
&>
(
rWrt
);
if
(
rHTMLWrt
.
mbSkipImages
)
return
rHTMLWrt
;
// ggf. ein noch offenes Attribut voruebergehend beenden
if
(
!
rHTMLWrt
.
aINetFmts
.
empty
()
)
{
SwFmtINetFmt
*
pINetFmt
=
rHTMLWrt
.
aINetFmts
.
back
();
OutHTML_INetFmt
(
rWrt
,
*
pINetFmt
,
false
);
}
const
SfxPoolItem
*
pItem
;
const
SfxItemSet
&
rItemSet
=
rFrmFmt
.
GetAttrSet
();
SwFmtURL
*
pURLItem
=
0
;
OUString
aIMapName
=
lclWriteOutImap
(
rHTMLWrt
,
rItemSet
,
rFrmFmt
,
rRealSize
,
pAltImgMap
,
pURLItem
);
// put img into new line
if
(
rHTMLWrt
.
bLFPossible
)
if
(
rHTMLWrt
.
bLFPossible
)
rHTMLWrt
.
OutNewLine
(
true
);
rHTMLWrt
.
OutNewLine
(
true
);
// Attribute die ausserhelb der Grafik geschreiben werden muessen sammeln
HtmlWriter
aHtml
(
rWrt
.
Strm
());
OStringBuffer
sOut
;
OString
aEndTags
;
//
implizite Sprungmarke -> <A NAME=...></A>...<IMG
...>
//
<a name=...></a>...<img
...>
if
(
pMarkType
&&
!
rFrmFmt
.
GetName
().
isEmpty
()
)
if
(
pMarkType
&&
!
rFrmFmt
.
GetName
().
isEmpty
()
)
{
rHTMLWrt
.
OutImplicitMark
(
rFrmFmt
.
GetName
(),
pMarkType
);
rHTMLWrt
.
OutImplicitMark
(
rFrmFmt
.
GetName
(),
pMarkType
);
}
// URL -> <
A>...<IMG ... >...</A
>
// URL -> <
a>...<img ... >...</a
>
const
SvxMacroItem
*
pMacItem
=
0
;
const
SvxMacroItem
*
pMacItem
=
0
;
if
(
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_FRMMACRO
,
true
,
&
pItem
))
if
(
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_FRMMACRO
,
true
,
&
pItem
))
{
pMacItem
=
(
const
SvxMacroItem
*
)
pItem
;
pMacItem
=
(
const
SvxMacroItem
*
)
pItem
;
}
if
(
pURLItem
||
pMacItem
)
if
(
pURLItem
||
pMacItem
)
{
{
OUString
aMapURL
;
OUString
aMapURL
;
OUString
aName
;
OUString
aName
;
OUString
aTarget
;
OUString
aTarget
;
if
(
pURLItem
)
if
(
pURLItem
)
{
{
aMapURL
=
pURLItem
->
GetURL
();
aMapURL
=
pURLItem
->
GetURL
();
aName
=
pURLItem
->
GetName
();
aName
=
pURLItem
->
GetName
();
aTarget
=
pURLItem
->
GetTargetFrameName
();
aTarget
=
pURLItem
->
GetTargetFrameName
();
}
}
bool
bEvents
=
pMacItem
&&
!
pMacItem
->
GetMacroTable
().
empty
();
bool
bEvents
=
pMacItem
&&
!
pMacItem
->
GetMacroTable
().
empty
();
if
(
!
aMapURL
.
isEmpty
()
||
!
aName
.
isEmpty
()
||
!
aTarget
.
isEmpty
()
||
bEvents
)
if
(
!
aMapURL
.
isEmpty
()
||
!
aName
.
isEmpty
()
||
!
aTarget
.
isEmpty
()
||
bEvents
)
{
{
sOut
.
append
(
'<'
).
append
(
OOO_STRING_SVTOOLS_HTML_anchor
);
aHtml
.
start
(
OOO_STRING_SVTOOLS_HTML_anchor
);
//
Ein HREF nur Ausgaben, wenn es einen Link oder Makros gibt
//
Output "href" element if a link or macro exists
if
(
!
aMapURL
.
isEmpty
()
||
bEvents
)
if
(
!
aMapURL
.
isEmpty
()
||
bEvents
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_href
).
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_href
,
OUStringToOString
(
rHTMLWrt
.
convertHyperlinkHRefValue
(
aMapURL
),
RTL_TEXTENCODING_UTF8
));
append
(
"=
\"
"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
rHTMLWrt
.
OutHyperlinkHRefValue
(
aMapURL
);
sOut
.
append
(
'\"'
);
}
}
if
(
!
aName
.
isEmpty
()
)
if
(
!
aName
.
isEmpty
()
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_name
).
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_name
,
OUStringToOString
(
aName
,
RTL_TEXTENCODING_UTF8
));
append
(
"=
\"
"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
HTMLOutFuncs
::
Out_String
(
rWrt
.
Strm
(),
aName
,
rHTMLWrt
.
eDestEnc
,
&
rHTMLWrt
.
aNonConvertableCharacters
);
sOut
.
append
(
'\"'
);
}
}
if
(
!
aTarget
.
isEmpty
()
)
if
(
!
aTarget
.
isEmpty
()
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_target
).
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_target
,
OUStringToOString
(
aTarget
,
RTL_TEXTENCODING_UTF8
));
append
(
"=
\"
"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
HTMLOutFuncs
::
Out_String
(
rWrt
.
Strm
(),
aTarget
,
rHTMLWrt
.
eDestEnc
,
&
rHTMLWrt
.
aNonConvertableCharacters
);
sOut
.
append
(
'\"'
);
}
}
if
(
!
sOut
.
isEmpty
())
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
if
(
pMacItem
)
if
(
pMacItem
)
{
{
const
SvxMacroTableDtor
&
rMacTable
=
pMacItem
->
GetMacroTable
();
const
SvxMacroTableDtor
&
rMacTable
=
pMacItem
->
GetMacroTable
();
if
(
!
rMacTable
.
empty
()
)
if
(
!
rMacTable
.
empty
())
HTMLOutFuncs
::
Out_Events
(
rWrt
.
Strm
(),
rMacTable
,
{
aAnchorEventTable
,
HtmlWriterHelper
::
applyEvents
(
aHtml
,
rMacTable
,
aAnchorEventTable
,
rHTMLWrt
.
bCfgStarBasic
);
rHTMLWrt
.
bCfgStarBasic
,
}
rHTMLWrt
.
eDestEnc
,
&
rHTMLWrt
.
aNonConvertableCharacters
);
}
}
rWrt
.
Strm
().
WriteCharPtr
(
">"
);
aEndTags
=
OStringBuffer
().
append
(
"</"
).
append
(
OOO_STRING_SVTOOLS_HTML_anchor
).
append
(
">"
).
append
(
aEndTags
).
makeStringAndClear
();
}
}
}
}
//
Umrandung -> <FONT COLOR = ...>...<IMG ... >...</FONT
>
//
<font color = ...>...<img ... >...</font
>
sal_uInt16
nBorderWidth
=
0
;
sal_uInt16
nBorderWidth
=
0
;
if
(
(
nFrmOpts
&
HTML_FRMOPT_BORDER
)
&&
if
(
(
nFrmOpts
&
HTML_FRMOPT_BORDER
)
&&
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_BOX
,
true
,
&
pItem
))
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_BOX
,
true
,
&
pItem
))
...
@@ -1098,74 +1350,57 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
...
@@ -1098,74 +1350,57 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrmFmt &rFrmFmt,
if
(
pColBorderLine
)
if
(
pColBorderLine
)
{
{
sOut
.
append
(
'<'
);
aHtml
.
start
(
OOO_STRING_SVTOOLS_HTML_font
);
sOut
.
append
(
OOO_STRING_SVTOOLS_HTML_font
).
append
(
' '
).
HtmlWriterHelper
::
applyColor
(
aHtml
,
OOO_STRING_SVTOOLS_HTML_O_color
,
pColBorderLine
->
GetColor
());
append
(
OOO_STRING_SVTOOLS_HTML_O_color
).
append
(
"="
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
HTMLOutFuncs
::
Out_Color
(
rWrt
.
Strm
(),
pColBorderLine
->
GetColor
(),
rHTMLWrt
.
eDestEnc
).
WriteChar
(
'>'
);
aEndTags
=
OStringBuffer
().
append
(
"</"
).
append
(
OOO_STRING_SVTOOLS_HTML_font
).
append
(
'>'
).
append
(
aEndTags
).
makeStringAndClear
();
}
}
}
}
sOut
.
append
(
'<'
);
aHtml
.
start
(
OOO_STRING_SVTOOLS_HTML_image
);
sOut
.
append
(
OOO_STRING_SVTOOLS_HTML_image
).
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_src
).
append
(
"=
\"
"
).
append
(
OOO_STRING_SVTOOLS_HTML_O_data
).
append
(
":"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
OUString
aGraphicInBase64
;
OUString
aGraphicInBase64
;
sal_uLong
nErr
=
XOutBitmap
::
GraphicToBase64
(
rGraphic
,
aGraphicInBase64
);
sal_uLong
nErr
=
XOutBitmap
::
GraphicToBase64
(
rGraphic
,
aGraphicInBase64
);
if
(
nErr
)
if
(
nErr
)
{
{
rHTMLWrt
.
nWarn
=
WARN_SWG_POOR_LOAD
|
WARN_SW_WRITE_BASE
;
rHTMLWrt
.
nWarn
=
WARN_SWG_POOR_LOAD
|
WARN_SW_WRITE_BASE
;
}
}
HTMLOutFuncs
::
Out_String
(
rWrt
.
Strm
(),
aGraphicInBase64
,
rHTMLWrt
.
eDestEnc
,
&
rHTMLWrt
.
aNonConvertableCharacters
).
WriteChar
(
'\"'
);
OStringBuffer
sBuffer
;
sBuffer
.
append
(
OOO_STRING_SVTOOLS_HTML_O_data
);
sBuffer
.
append
(
":"
);
sBuffer
.
append
(
OUStringToOString
(
aGraphicInBase64
,
RTL_TEXTENCODING_UTF8
));
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_src
,
sBuffer
.
makeStringAndClear
().
getStr
());
// Events
// Events
if
(
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_FRMMACRO
,
true
,
&
pItem
))
if
(
SfxItemState
::
SET
==
rItemSet
.
GetItemState
(
RES_FRMMACRO
,
true
,
&
pItem
))
{
{
const
SvxMacroTableDtor
&
rMacTable
=
const
SvxMacroTableDtor
&
rMacTable
=
((
const
SvxMacroItem
*
)
pItem
)
->
GetMacroTable
();
((
const
SvxMacroItem
*
)
pItem
)
->
GetMacroTable
();
if
(
!
rMacTable
.
empty
())
if
(
!
rMacTable
.
empty
()
)
{
HTMLOutFuncs
::
Out_Events
(
rWrt
.
Strm
(),
rMacTable
,
aImageEventTable
,
HtmlWriterHelper
::
applyEvents
(
aHtml
,
rMacTable
,
aImageEventTable
,
rHTMLWrt
.
bCfgStarBasic
);
rHTMLWrt
.
bCfgStarBasic
,
rHTMLWrt
.
eDestEnc
,
}
&
rHTMLWrt
.
aNonConvertableCharacters
);
}
}
//
ALT, ALIGN, WIDTH, HEIGHT, HSPACE, VSPACE
//
alt, align, width, height, hspace, vspace
aEndTags
=
rHTMLWrt
.
OutFrmFmtOptions
(
rFrmFmt
,
rAlternateTxt
,
nFrmOpts
,
aEndTags
);
rHTMLWrt
.
writeFrameFormatOptions
(
aHtml
,
rFrmFmt
,
rAlternateTxt
,
nFrmOpts
);
if
(
rHTMLWrt
.
IsHTMLMode
(
HTMLMODE_ABS_POS_FLY
)
)
if
(
rHTMLWrt
.
IsHTMLMode
(
HTMLMODE_ABS_POS_FLY
)
)
rHTMLWrt
.
OutCSS1_FrmFmtOptions
(
rFrmFmt
,
nFrmOpts
);
rHTMLWrt
.
OutCSS1_FrmFmtOptions
(
rFrmFmt
,
nFrmOpts
);
if
(
nFrmOpts
&
HTML_FRMOPT_BORDER
)
if
(
nFrmOpts
&
HTML_FRMOPT_BORDER
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_border
).
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_border
,
nBorderWidth
);
append
(
"=
\"
"
).
append
(
static_cast
<
sal_Int32
>
(
nBorderWidth
)).
append
(
"
\"
"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
}
}
if
(
pURLItem
&&
pURLItem
->
IsServerMap
()
)
if
(
pURLItem
&&
pURLItem
->
IsServerMap
()
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_ismap
);
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_ismap
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
}
}
if
(
!
aIMapName
.
isEmpty
()
)
if
(
!
aIMapName
.
isEmpty
()
)
{
{
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_usemap
).
aHtml
.
attribute
(
OOO_STRING_SVTOOLS_HTML_O_usemap
,
"#"
+
aIMapName
);
append
(
"=
\"
#"
);
rWrt
.
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
HTMLOutFuncs
::
Out_String
(
rWrt
.
Strm
(),
aIMapName
,
rHTMLWrt
.
eDestEnc
,
&
rHTMLWrt
.
aNonConvertableCharacters
).
WriteChar
(
'\"'
);
}
}
rHTMLWrt
.
Strm
().
WriteChar
(
'>'
);
aHtml
.
flushStack
();
if
(
!
aEndTags
.
isEmpty
()
)
rWrt
.
Strm
().
WriteCharPtr
(
aEndTags
.
getStr
()
);
if
(
!
rHTMLWrt
.
aINetFmts
.
empty
()
)
if
(
!
rHTMLWrt
.
aINetFmts
.
empty
()
)
{
{
...
...
sw/source/filter/html/wrthtml.cxx
Dosyayı görüntüle @
03fe839d
...
@@ -1171,32 +1171,32 @@ void SwHTMLWriter::OutImplicitMark( const OUString& rMark,
...
@@ -1171,32 +1171,32 @@ void SwHTMLWriter::OutImplicitMark( const OUString& rMark,
}
}
}
}
void
SwHTMLWriter
::
OutHyperlinkHRefValue
(
const
OUString
&
rURL
)
OUString
SwHTMLWriter
::
convertHyperlinkHRefValue
(
const
OUString
&
rURL
)
{
{
OUString
sURL
(
rURL
);
OUString
sURL
(
rURL
);
sal_Int32
nPos
=
sURL
.
lastIndexOf
(
cMarkSeparator
);
sal_Int32
nPos
=
sURL
.
lastIndexOf
(
cMarkSeparator
);
if
(
nPos
!=
-
1
)
if
(
nPos
!=
-
1
)
{
{
OUString
sCmp
(
comphelper
::
string
::
remove
(
sURL
.
copy
(
nPos
+
1
),
' '
));
OUString
sCompare
(
comphelper
::
string
::
remove
(
sURL
.
copy
(
nPos
+
1
),
' '
));
if
(
!
sCmp
.
isEmpty
()
)
if
(
!
sCompare
.
isEmpty
())
{
{
sCmp
=
sCmp
.
toAsciiLowerCase
();
sCompare
=
sCompare
.
toAsciiLowerCase
();
if
(
sCmp
==
"region"
||
if
(
sCompare
==
"region"
||
sCompare
==
"frame"
||
sCmp
==
"frame"
||
sCompare
==
"graphic"
||
sCompare
==
"ole"
||
sCmp
==
"graphic"
||
sCompare
==
"table"
||
sCompare
==
"outline"
||
sCmp
==
"ole"
||
sCompare
==
"text"
)
sCmp
==
"table"
||
sCmp
==
"outline"
||
sCmp
==
"text"
)
{
{
sURL
=
sURL
.
replace
(
'?'
,
'_'
);
// '?' causes problems in IE/Netscape 5
sURL
=
sURL
.
replace
(
'?'
,
'_'
);
// '?' causes problems in IE/Netscape 5
}
}
}
}
}
}
return
URIHelper
::
simpleNormalizedMakeRelative
(
GetBaseURL
(),
sURL
);
}
sURL
=
URIHelper
::
simpleNormalizedMakeRelative
(
GetBaseURL
(),
sURL
);
void
SwHTMLWriter
::
OutHyperlinkHRefValue
(
const
OUString
&
rURL
)
HTMLOutFuncs
::
Out_String
(
Strm
(),
sURL
,
eDestEnc
,
{
&
aNonConvertableCharacters
);
OUString
sURL
=
convertHyperlinkHRefValue
(
rURL
);
HTMLOutFuncs
::
Out_String
(
Strm
(),
sURL
,
eDestEnc
,
&
aNonConvertableCharacters
);
}
}
void
SwHTMLWriter
::
OutBackground
(
const
SvxBrushItem
*
pBrushItem
,
bool
bGraphic
)
void
SwHTMLWriter
::
OutBackground
(
const
SvxBrushItem
*
pBrushItem
,
bool
bGraphic
)
...
@@ -1297,25 +1297,31 @@ sal_uInt16 SwHTMLWriter::GetHTMLDirection( sal_uInt16 nDir ) const
...
@@ -1297,25 +1297,31 @@ sal_uInt16 SwHTMLWriter::GetHTMLDirection( sal_uInt16 nDir ) const
void
SwHTMLWriter
::
OutDirection
(
sal_uInt16
nDir
)
void
SwHTMLWriter
::
OutDirection
(
sal_uInt16
nDir
)
{
{
const
sal_Char
*
pValue
=
0
;
OString
sConverted
=
convertDirection
(
nDir
);
switch
(
nDir
)
if
(
!
sConverted
.
isEmpty
())
{
OStringBuffer
sOut
;
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_dir
)
.
append
(
"=
\"
"
).
append
(
sConverted
).
append
(
'\"'
);
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
}
}
OString
SwHTMLWriter
::
convertDirection
(
sal_uInt16
nDirection
)
{
OString
sConverted
;
switch
(
nDirection
)
{
{
case
FRMDIR_HORI_LEFT_TOP
:
case
FRMDIR_HORI_LEFT_TOP
:
case
FRMDIR_VERT_TOP_LEFT
:
case
FRMDIR_VERT_TOP_LEFT
:
pValue
=
"ltr"
;
sConverted
=
"ltr"
;
break
;
break
;
case
FRMDIR_HORI_RIGHT_TOP
:
case
FRMDIR_HORI_RIGHT_TOP
:
case
FRMDIR_VERT_TOP_RIGHT
:
case
FRMDIR_VERT_TOP_RIGHT
:
pValue
=
"rtl"
;
sConverted
=
"rtl"
;
break
;
break
;
}
}
if
(
pValue
!=
0
)
return
sConverted
;
{
OStringBuffer
sOut
;
sOut
.
append
(
' '
).
append
(
OOO_STRING_SVTOOLS_HTML_O_dir
)
.
append
(
"=
\"
"
).
append
(
pValue
).
append
(
'\"'
);
Strm
().
WriteCharPtr
(
sOut
.
makeStringAndClear
().
getStr
()
);
}
}
}
OString
SwHTMLWriter
::
GetIndentString
(
sal_uInt16
nIncLvl
)
OString
SwHTMLWriter
::
GetIndentString
(
sal_uInt16
nIncLvl
)
...
...
sw/source/filter/html/wrthtml.hxx
Dosyayı görüntüle @
03fe839d
...
@@ -414,6 +414,9 @@ public:
...
@@ -414,6 +414,9 @@ public:
void
OutBookmarks
();
void
OutBookmarks
();
void
OutPointFieldmarks
(
const
SwPosition
&
rPos
);
void
OutPointFieldmarks
(
const
SwPosition
&
rPos
);
void
OutImplicitMark
(
const
OUString
&
rMark
,
const
sal_Char
*
pMarkType
);
void
OutImplicitMark
(
const
OUString
&
rMark
,
const
sal_Char
*
pMarkType
);
OUString
convertHyperlinkHRefValue
(
const
OUString
&
rURL
);
void
OutHyperlinkHRefValue
(
const
OUString
&
rURL
);
void
OutHyperlinkHRefValue
(
const
OUString
&
rURL
);
// gebe die evt. an der akt. Position stehenden FlyFrame aus.
// gebe die evt. an der akt. Position stehenden FlyFrame aus.
...
@@ -465,12 +468,16 @@ public:
...
@@ -465,12 +468,16 @@ public:
sal_uInt16
GetHTMLDirection
(
sal_uInt16
nDir
)
const
;
sal_uInt16
GetHTMLDirection
(
sal_uInt16
nDir
)
const
;
sal_uInt16
GetHTMLDirection
(
const
SfxItemSet
&
rItemSet
)
const
;
sal_uInt16
GetHTMLDirection
(
const
SfxItemSet
&
rItemSet
)
const
;
void
OutDirection
(
sal_uInt16
nDir
);
void
OutDirection
(
sal_uInt16
nDir
);
OString
convertDirection
(
sal_uInt16
nDirection
);
// ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE-Optionen des aktuellen
// ALT/ALIGN/WIDTH/HEIGHT/HSPACE/VSPACE-Optionen des aktuellen
// Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an
// Frame-Formats ausgeben und ggf. ein <BR CLEAR=...> vorne an
// rEndTags anhaengen
// rEndTags anhaengen
OString
OutFrmFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
,
const
OUString
&
rAltTxt
,
OString
OutFrmFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
,
const
OUString
&
rAltTxt
,
sal_uInt32
nFrmOpts
,
const
OString
&
rEndTags
=
OString
()
);
sal_uInt32
nFrmOpts
,
const
OString
&
rEndTags
=
OString
()
);
void
writeFrameFormatOptions
(
HtmlWriter
&
aHtml
,
const
SwFrmFmt
&
rFrmFmt
,
const
OUString
&
rAltTxt
,
sal_uInt32
nFrmOpts
);
void
OutCSS1_TableFrmFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
);
void
OutCSS1_TableFrmFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
);
void
OutCSS1_TableCellBorderHack
(
const
SwFrmFmt
&
rFrmFmt
);
void
OutCSS1_TableCellBorderHack
(
const
SwFrmFmt
&
rFrmFmt
);
void
OutCSS1_SectionFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
,
const
SwFmtCol
*
pCol
);
void
OutCSS1_SectionFmtOptions
(
const
SwFrmFmt
&
rFrmFmt
,
const
SwFmtCol
*
pCol
);
...
...
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