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
845e8478
Kaydet (Commit)
845e8478
authored
Eki 17, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
import RTF_DODHGT
Change-Id: I6e97c33569e46171ed702b573d42ced805cded78
üst
a4e2e50c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
8 deletions
+45
-8
do-dhgt.rtf
sw/qa/extras/rtfimport/data/do-dhgt.rtf
+9
-0
rtfimport.cxx
sw/qa/extras/rtfimport/rtfimport.cxx
+19
-0
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+6
-1
rtfdocumentimpl.hxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
+1
-0
rtfsdrimport.cxx
writerfilter/source/rtftok/rtfsdrimport.cxx
+9
-7
rtfsdrimport.hxx
writerfilter/source/rtftok/rtfsdrimport.hxx
+1
-0
No files found.
sw/qa/extras/rtfimport/data/do-dhgt.rtf
0 → 100644
Dosyayı görüntüle @
845e8478
{\rtf1
{\*\do\dobxcolumn\dobypara\dodhgt251658240\dprect\dpx1275\dpy-135\dpxsize1770\dpysize855
\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr79\dpfillbgcg129\dpfillbgcb189\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
{\*\do\dobxcolumn\dobypara\dodhgt251657727\dprect\dpx2475\dpy150\dpxsize2025\dpysize1080
\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr155\dpfillbgcg187\dpfillbgcb89\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
{\*\do\dobxcolumn\dobypara\dodhgt251657215\dprect\dpx1560\dpy420\dpxsize2325\dpysize1365
\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr192\dpfillbgcg80\dpfillbgcb77\dpfillpat1\dplinew60\dplinecor242\dplinecog242\dplinecob242}
\par
}
sw/qa/extras/rtfimport/rtfimport.cxx
Dosyayı görüntüle @
845e8478
...
@@ -116,6 +116,7 @@ public:
...
@@ -116,6 +116,7 @@ public:
void
testFdo55493
();
void
testFdo55493
();
void
testCopyPastePageStyle
();
void
testCopyPastePageStyle
();
void
testShptxtPard
();
void
testShptxtPard
();
void
testDoDhgt
();
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
#if !defined(MACOSX) && !defined(WNT)
...
@@ -171,6 +172,7 @@ public:
...
@@ -171,6 +172,7 @@ public:
CPPUNIT_TEST
(
testFdo55493
);
CPPUNIT_TEST
(
testFdo55493
);
CPPUNIT_TEST
(
testCopyPastePageStyle
);
CPPUNIT_TEST
(
testCopyPastePageStyle
);
CPPUNIT_TEST
(
testShptxtPard
);
CPPUNIT_TEST
(
testShptxtPard
);
CPPUNIT_TEST
(
testDoDhgt
);
#endif
#endif
CPPUNIT_TEST_SUITE_END
();
CPPUNIT_TEST_SUITE_END
();
...
@@ -905,6 +907,23 @@ void Test::testShptxtPard()
...
@@ -905,6 +907,23 @@ void Test::testShptxtPard()
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"shape text"
),
xText
->
getString
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"shape text"
),
xText
->
getString
());
}
}
void
Test
::
testDoDhgt
()
{
load
(
"do-dhgt.rtf"
);
uno
::
Reference
<
drawing
::
XDrawPageSupplier
>
xDrawPageSupplier
(
mxComponent
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
container
::
XIndexAccess
>
xDraws
(
xDrawPageSupplier
->
getDrawPage
(),
uno
::
UNO_QUERY
);
for
(
int
i
=
0
;
i
<
xDraws
->
getCount
();
++
i
)
{
sal_Int32
nFillColor
=
getProperty
<
sal_Int32
>
(
xDraws
->
getByIndex
(
i
),
"FillColor"
);
if
(
nFillColor
==
0xc0504d
)
// red
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
0
),
getProperty
<
sal_Int32
>
(
xDraws
->
getByIndex
(
i
),
"ZOrder"
));
else
if
(
nFillColor
==
0x9bbb59
)
// green
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
1
),
getProperty
<
sal_Int32
>
(
xDraws
->
getByIndex
(
i
),
"ZOrder"
));
else
if
(
nFillColor
==
0x4f81bd
)
// blue
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
2
),
getProperty
<
sal_Int32
>
(
xDraws
->
getByIndex
(
i
),
"ZOrder"
));
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
845e8478
...
@@ -2310,6 +2310,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
...
@@ -2310,6 +2310,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
std
::
vector
<
beans
::
PropertyValue
>&
rPendingProperties
=
m_aStates
.
top
().
aDrawingObject
.
aPendingProperties
;
std
::
vector
<
beans
::
PropertyValue
>&
rPendingProperties
=
m_aStates
.
top
().
aDrawingObject
.
aPendingProperties
;
for
(
std
::
vector
<
beans
::
PropertyValue
>::
iterator
i
=
rPendingProperties
.
begin
();
i
!=
rPendingProperties
.
end
();
++
i
)
for
(
std
::
vector
<
beans
::
PropertyValue
>::
iterator
i
=
rPendingProperties
.
begin
();
i
!=
rPendingProperties
.
end
();
++
i
)
m_aStates
.
top
().
aDrawingObject
.
xPropertySet
->
setPropertyValue
(
i
->
Name
,
i
->
Value
);
m_aStates
.
top
().
aDrawingObject
.
xPropertySet
->
setPropertyValue
(
i
->
Name
,
i
->
Value
);
m_pSdrImport
->
resolveDhgt
(
m_aStates
.
top
().
aDrawingObject
.
xPropertySet
,
m_aStates
.
top
().
aDrawingObject
.
nDhgt
);
}
}
break
;
break
;
case
RTF_DOBXMARGIN
:
case
RTF_DOBXMARGIN
:
...
@@ -3136,6 +3137,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
...
@@ -3136,6 +3137,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
lcl_putNestedAttribute
(
m_aStates
.
top
().
aTableCellSprms
,
NS_ooxml
::
LN_CT_TcPrBase_shd
,
NS_ooxml
::
LN_CT_Shd_val
,
RTFValue
::
Pointer_t
(
new
RTFValue
(
nValue
)));
lcl_putNestedAttribute
(
m_aStates
.
top
().
aTableCellSprms
,
NS_ooxml
::
LN_CT_TcPrBase_shd
,
NS_ooxml
::
LN_CT_Shd_val
,
RTFValue
::
Pointer_t
(
new
RTFValue
(
nValue
)));
}
}
break
;
break
;
case
RTF_DODHGT
:
m_aStates
.
top
().
aDrawingObject
.
nDhgt
=
nParam
;
break
;
default
:
default
:
SAL_INFO
(
"writerfilter"
,
OSL_THIS_FUNC
<<
": TODO handle value '"
<<
lcl_RtfToString
(
nKeyword
)
<<
"'"
);
SAL_INFO
(
"writerfilter"
,
OSL_THIS_FUNC
<<
": TODO handle value '"
<<
lcl_RtfToString
(
nKeyword
)
<<
"'"
);
aSkip
.
setParsed
(
false
);
aSkip
.
setParsed
(
false
);
...
@@ -4122,7 +4126,8 @@ RTFDrawingObject::RTFDrawingObject()
...
@@ -4122,7 +4126,8 @@ RTFDrawingObject::RTFDrawingObject()
nFillColorR
(
0
),
nFillColorR
(
0
),
nFillColorG
(
0
),
nFillColorG
(
0
),
nFillColorB
(
0
),
nFillColorB
(
0
),
bHasFillColor
(
false
)
bHasFillColor
(
false
),
nDhgt
(
0
)
{
{
}
}
...
...
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Dosyayı görüntüle @
845e8478
...
@@ -272,6 +272,7 @@ namespace writerfilter {
...
@@ -272,6 +272,7 @@ namespace writerfilter {
bool
bHasLineColor
;
bool
bHasLineColor
;
sal_uInt8
nFillColorR
,
nFillColorG
,
nFillColorB
;
sal_uInt8
nFillColorR
,
nFillColorG
,
nFillColorB
;
bool
bHasFillColor
;
bool
bHasFillColor
;
sal_Int32
nDhgt
;
};
};
/// Stores the properties of a picture.
/// Stores the properties of a picture.
...
...
writerfilter/source/rtftok/rtfsdrimport.cxx
Dosyayı görüntüle @
845e8478
...
@@ -71,6 +71,14 @@ void RTFSdrImport::createShape(OUString aStr, uno::Reference<drawing::XShape>& x
...
@@ -71,6 +71,14 @@ void RTFSdrImport::createShape(OUString aStr, uno::Reference<drawing::XShape>& x
xPropertySet
.
set
(
xShape
,
uno
::
UNO_QUERY
);
xPropertySet
.
set
(
xShape
,
uno
::
UNO_QUERY
);
}
}
void
RTFSdrImport
::
resolveDhgt
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropertySet
,
sal_Int32
nZOrder
)
{
writerfilter
::
dmapper
::
DomainMapper
&
rMapper
=
(
writerfilter
::
dmapper
::
DomainMapper
&
)
m_rImport
.
Mapper
();
writerfilter
::
dmapper
::
GraphicZOrderHelper
*
pHelper
=
rMapper
.
graphicZOrderHelper
();
xPropertySet
->
setPropertyValue
(
"ZOrder"
,
uno
::
makeAny
(
pHelper
->
findZOrder
(
nZOrder
)));
pHelper
->
addItem
(
xPropertySet
,
nZOrder
);
}
void
RTFSdrImport
::
resolve
(
RTFShape
&
rShape
)
void
RTFSdrImport
::
resolve
(
RTFShape
&
rShape
)
{
{
int
nType
=
-
1
;
int
nType
=
-
1
;
...
@@ -281,13 +289,7 @@ void RTFSdrImport::resolve(RTFShape& rShape)
...
@@ -281,13 +289,7 @@ void RTFSdrImport::resolve(RTFShape& rShape)
else
if
(
i
->
first
==
"geoBottom"
)
else
if
(
i
->
first
==
"geoBottom"
)
aViewBox
.
Height
=
i
->
second
.
toInt32
();
aViewBox
.
Height
=
i
->
second
.
toInt32
();
else
if
(
i
->
first
==
"dhgt"
)
else
if
(
i
->
first
==
"dhgt"
)
{
resolveDhgt
(
xPropertySet
,
i
->
second
.
toInt32
());
writerfilter
::
dmapper
::
DomainMapper
&
rMapper
=
(
writerfilter
::
dmapper
::
DomainMapper
&
)
m_rImport
.
Mapper
();
writerfilter
::
dmapper
::
GraphicZOrderHelper
*
pHelper
=
rMapper
.
graphicZOrderHelper
();
sal_Int32
nZOrder
=
i
->
second
.
toInt32
();
xPropertySet
->
setPropertyValue
(
"ZOrder"
,
uno
::
makeAny
(
pHelper
->
findZOrder
(
nZOrder
)));
pHelper
->
addItem
(
xPropertySet
,
nZOrder
);
}
else
else
SAL_INFO
(
"writerfilter"
,
OSL_THIS_FUNC
<<
": TODO handle shape property '"
<<
SAL_INFO
(
"writerfilter"
,
OSL_THIS_FUNC
<<
": TODO handle shape property '"
<<
OUStringToOString
(
i
->
first
,
RTL_TEXTENCODING_UTF8
).
getStr
()
<<
"':'"
<<
OUStringToOString
(
i
->
first
,
RTL_TEXTENCODING_UTF8
).
getStr
()
<<
"':'"
<<
...
...
writerfilter/source/rtftok/rtfsdrimport.hxx
Dosyayı görüntüle @
845e8478
...
@@ -40,6 +40,7 @@ namespace writerfilter {
...
@@ -40,6 +40,7 @@ namespace writerfilter {
virtual
~
RTFSdrImport
();
virtual
~
RTFSdrImport
();
void
resolve
(
RTFShape
&
rShape
);
void
resolve
(
RTFShape
&
rShape
);
void
resolveDhgt
(
uno
::
Reference
<
beans
::
XPropertySet
>
xPropertySet
,
sal_Int32
nZOrder
);
private
:
private
:
void
createShape
(
rtl
::
OUString
aService
,
uno
::
Reference
<
drawing
::
XShape
>&
xShape
,
uno
::
Reference
<
beans
::
XPropertySet
>&
xPropertySet
);
void
createShape
(
rtl
::
OUString
aService
,
uno
::
Reference
<
drawing
::
XShape
>&
xShape
,
uno
::
Reference
<
beans
::
XPropertySet
>&
xPropertySet
);
...
...
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