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
9f9fa48a
Kaydet (Commit)
9f9fa48a
authored
Mar 11, 2016
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
writerfilter: avoid ugly cross-directory include
Change-Id: I16db4e16e5c2fa3aa3bfb22f83d2c36695499b5c
üst
5d593158
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
30 deletions
+30
-30
Library_writerfilter.mk
writerfilter/Library_writerfilter.mk
+0
-1
DomainMapperFactory.hxx
writerfilter/inc/dmapper/DomainMapperFactory.hxx
+6
-0
misc.cxx
writerfilter/qa/cppunittests/misc/misc.cxx
+20
-20
DomainMapper_Impl.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
+2
-3
DomainMapper_Impl.hxx
writerfilter/source/dmapper/DomainMapper_Impl.hxx
+0
-4
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+2
-2
No files found.
writerfilter/Library_writerfilter.mk
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -21,7 +21,6 @@ $(eval $(call gb_Library_set_include,writerfilter,\
$$(INCLUDE) \
-I$(SRCDIR)/writerfilter/inc \
-I$(SRCDIR)/writerfilter/source \
-I$(SRCDIR)/writerfilter/source/dmapper \
))
$(eval $(call gb_Library_use_sdk_api,writerfilter))
...
...
writerfilter/inc/dmapper/DomainMapperFactory.hxx
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -9,6 +9,8 @@
#ifndef INCLUDED_WRITERFILTER_INC_DMAPPER_DOMAINMAPPERFACTORY_HXX
#define INCLUDED_WRITERFILTER_INC_DMAPPER_DOMAINMAPPERFACTORY_HXX
#include <vector>
#include <dmapper/resourcemodel.hxx>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XComponent.hpp>
...
...
@@ -42,6 +44,10 @@ public:
SourceDocumentType
eDocumentType
,
utl
::
MediaDescriptor
&
rMediaDesc
);
};
// export just for test
SAL_DLLPUBLIC_EXPORT
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
splitFieldCommand
(
const
OUString
&
rCommand
);
}
// namespace dmapper
}
// namespace writerfilter
...
...
writerfilter/qa/cppunittests/misc/misc.cxx
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -59,80 +59,80 @@ void WriterfilterMiscTest::testTwipConversions()
void
WriterfilterMiscTest
::
testFieldParameters
()
{
using
writerfilter
::
dmapper
::
lcl_S
plitFieldCommand
;
using
writerfilter
::
dmapper
::
s
plitFieldCommand
;
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
result
;
result
=
lcl_S
plitFieldCommand
(
"PAGEREF last_page"
);
result
=
s
plitFieldCommand
(
"PAGEREF last_page"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
" PAGEREF last_page "
);
result
=
s
plitFieldCommand
(
" PAGEREF last_page "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
result
=
lcl_S
plitFieldCommand
(
"pageref last_page"
);
result
=
s
plitFieldCommand
(
"pageref last_page"
);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"pageref
\"
last_page
\"
"
);
result
=
s
plitFieldCommand
(
"pageref
\"
last_page
\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGEREF
\"
\"
last_page
\"
\"\"
"
);
result
=
s
plitFieldCommand
(
"
\"
PAGEREF
\"
\"
last_page
\"
\"\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
2
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(),
std
::
get
<
1
>
(
result
)[
1
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGEREF
\"\"
last_page
\"
"
);
result
=
s
plitFieldCommand
(
"
\"
PAGEREF
\"\"
last_page
\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"PAGEREF
\"
last_page
\"
"
);
result
=
s
plitFieldCommand
(
"PAGEREF
\"
last_page
\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGEREF
\"
last_page
\"\"
"
);
result
=
s
plitFieldCommand
(
"
\"
PAGEREF
\"
last_page
\"\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
2
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(),
std
::
get
<
1
>
(
result
)[
1
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGEREF
\"
last_page
\"\"
"
);
result
=
s
plitFieldCommand
(
"
\"
PAGEREF
\"
last_page
\"\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
2
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(),
std
::
get
<
1
>
(
result
)[
1
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"pageref
\"
last
\\\\
pa
\\\"
ge
\"
"
);
result
=
s
plitFieldCommand
(
"pageref
\"
last
\\\\
pa
\\\"
ge
\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last
\\
pa
\"
ge"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT
(
std
::
get
<
2
>
(
result
).
empty
());
result
=
lcl_S
plitFieldCommand
(
"PAGEREF
\"
last_page
\"\\
*"
);
result
=
s
plitFieldCommand
(
"PAGEREF
\"
last_page
\"\\
*"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
2
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
\\
*"
),
std
::
get
<
2
>
(
result
)[
0
]);
result
=
lcl_S
plitFieldCommand
(
"PAGEREF last_page
\\
b foobar "
);
result
=
s
plitFieldCommand
(
"PAGEREF last_page
\\
b foobar "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
size_t
(
1
),
std
::
get
<
1
>
(
result
).
size
());
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"last_page"
),
std
::
get
<
1
>
(
result
)[
0
]);
...
...
@@ -140,7 +140,7 @@ void WriterfilterMiscTest::testFieldParameters()
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
\\
B"
),
std
::
get
<
2
>
(
result
)[
0
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobar"
),
std
::
get
<
2
>
(
result
)[
1
]);
result
=
lcl_S
plitFieldCommand
(
"PAGEREF
\\
bfoobar
\\
A
\"\"
"
);
result
=
s
plitFieldCommand
(
"PAGEREF
\\
bfoobar
\\
A
\"\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGEREF"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT
(
std
::
get
<
1
>
(
result
).
empty
());
CPPUNIT_ASSERT_EQUAL
(
size_t
(
4
),
std
::
get
<
2
>
(
result
).
size
());
...
...
@@ -154,19 +154,19 @@ void WriterfilterMiscTest::testFieldParameters()
"]"
,
"^"
,
"_"
,
"`"
,
"{"
,
"|"
,
"}"
,
"~"
})
{
OUString
test
(
OUString
::
createFromAscii
(
prefix
)
+
"PAGE"
);
result
=
lcl_S
plitFieldCommand
(
test
+
" "
);
result
=
s
plitFieldCommand
(
test
+
" "
);
CPPUNIT_ASSERT_EQUAL
(
test
,
std
::
get
<
0
>
(
result
));
}
result
=
lcl_S
plitFieldCommand
(
"
\\
PAGE "
);
result
=
s
plitFieldCommand
(
"
\\
PAGE "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGE"
),
std
::
get
<
0
>
(
result
));
result
=
lcl_S
plitFieldCommand
(
"
\\
PAGE "
);
result
=
s
plitFieldCommand
(
"
\\
PAGE "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
\\
"
),
std
::
get
<
0
>
(
result
));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGE"
),
std
::
get
<
1
>
(
result
)[
0
]);
result
=
lcl_S
plitFieldCommand
(
"
\\\\
PAGE "
);
result
=
s
plitFieldCommand
(
"
\\\\
PAGE "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
\\
PAGE"
),
std
::
get
<
0
>
(
result
));
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGE
\"
"
);
result
=
s
plitFieldCommand
(
"
\"
PAGE
\"
"
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGE"
),
std
::
get
<
0
>
(
result
));
result
=
lcl_S
plitFieldCommand
(
"
\"
PAGE "
);
result
=
s
plitFieldCommand
(
"
\"
PAGE "
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"PAGE "
),
std
::
get
<
0
>
(
result
));
}
...
...
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -2283,8 +2283,7 @@ static OUString lcl_ExtractToken(OUString const& rCommand,
return
token
.
makeStringAndClear
();
}
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
lcl_SplitFieldCommand
(
const
OUString
&
rCommand
)
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
splitFieldCommand
(
const
OUString
&
rCommand
)
{
OUString
sType
;
std
::
vector
<
OUString
>
arguments
;
...
...
@@ -3550,7 +3549,7 @@ void DomainMapper_Impl::CloseFieldCommand()
uno
::
Reference
<
uno
::
XInterface
>
xFieldInterface
;
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
const
field
(
lcl_S
plitFieldCommand
(
pContext
->
GetCommand
()));
field
(
s
plitFieldCommand
(
pContext
->
GetCommand
()));
OUString
const
sFirstParam
(
std
::
get
<
1
>
(
field
).
empty
()
?
OUString
()
:
std
::
get
<
1
>
(
field
).
front
());
...
...
writerfilter/source/dmapper/DomainMapper_Impl.hxx
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -870,10 +870,6 @@ private:
bool
m_bParaHadField
;
};
// export just for test
SAL_DLLPUBLIC_EXPORT
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
lcl_SplitFieldCommand
(
const
OUString
&
rCommand
);
}
//namespace dmapper
}
//namespace writerfilter
#endif
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
9f9fa48a
...
...
@@ -40,7 +40,7 @@
#include <oox/token/namespaces.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <rtl/uri.hxx>
#include <dmapper/DomainMapper
_Impl
.hxx>
#include <dmapper/DomainMapper
Factory
.hxx>
#include <rtfsdrimport.hxx>
#include <rtflookahead.hxx>
#include <rtfcharsets.hxx>
...
...
@@ -1575,7 +1575,7 @@ RTFError RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword)
aBuf
.
append
(
ch
);
}
OUString
aFieldCommand
=
OStringToOUString
(
aBuf
.
toString
(),
RTL_TEXTENCODING_UTF8
);
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
aResult
=
writerfilter
::
dmapper
::
lcl_S
plitFieldCommand
(
aFieldCommand
);
std
::
tuple
<
OUString
,
std
::
vector
<
OUString
>
,
std
::
vector
<
OUString
>
>
aResult
=
writerfilter
::
dmapper
::
s
plitFieldCommand
(
aFieldCommand
);
m_aPicturePath
=
std
::
get
<
1
>
(
aResult
).
empty
()
?
OUString
()
:
std
::
get
<
1
>
(
aResult
).
front
();
}
...
...
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