#include "GuiDocument.h"
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
parsing
::
tabling
;
using
namespace
parsing
::
xml
;
using
namespace
regex
;
using
namespace
stream
;
::
(
const
&
)
{
if
(
.
() >
0
&&
.
() -
1
] ==
L'x'
)
{
return
(
(
.
(
.
() -
1
)),
true
);
}
else
{
return
(
(
),
false
);
}
}
::
()
const
{
return
(
) + (
?
L"x"
:
L""
);
}
const
wchar_t
*
::
=
L"[Image]"
;
const
wchar_t
*
DocumentEmbeddedObjectRun
::
=
L"[EmbeddedObject]"
;
namespace
document_operation_visitors
{
class
:
public
,
public
::
{
public
:
stream
::
& ;
bool
;
(
stream
::
& ,
bool
)
:writer(
)
,skipNonTextContent(
)
{
}
void
(
* )
{
FOREACH(Ptr<DocumentRun>, subRun, run->runs)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>& = ::
vl
::
collections
::
(
->
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
> ;
__foreach_iterator__
.
(
subRun
);)
{
subRun
(
this
);
}
}
void
(
* )
{
.
(
->
());
}
void
(
* )
override
{
(
);
}
void
(
DocumentStylePropertiesRun
* )
override
{
(
);
}
void
(
DocumentStyleApplicationRun
* )
override
{
(
);
}
void
(
* )
override
{
(
);
}
void
(
* )
override
{
if
(!
)
{
(
);
}
}
void
(
DocumentEmbeddedObjectRun
* )
override
{
if
(!
)
{
(
);
}
}
void
(
* )
override
{
(
);
}
};
}
using
namespace
document_operation_visitors
;
::
(
bool
)
{
return
([&](
&
)
{
(
writer
,
);
});
}
void
::
(
stream
::
&
,
bool
)
{
(
,
);
(&
visitor
);
}
const
wchar_t
*
::
=
L"#Default"
;
const
wchar_t
*
::
=
L"#Selection"
;
const
wchar_t
*
::
=
L"#Context"
;
const
wchar_t
*
::
=
L"#NormalLink"
;
const
wchar_t
*
::
=
L"#ActiveLink"
;
::
()
{
{
=
()->
()->
();
<
>
=
new
;
sp
font
.
;
sp
((
double
)
font
.
,
false
);
sp
();
sp
(
0
,
0
,
0
,
0
);
sp
font
.
;
sp
font
.
;
sp
font
.
;
sp
font
.
;
sp
font
.
;
sp
font
.
;
<
>
=
new
;
style
sp
;
.
(
L"#Default"
,
style
);
}
{
<
>
=
new
;
sp
(
255
,
255
,
255
);
sp
(
51
,
153
,
255
);
<
>
=
new
;
style
sp
;
.
(
L"#Selection"
,
style
);
}
{
<
>
=
new
;
<
>
=
new
;
style
sp
;
.
(
L"#Context"
,
style
);
}
{
<
>
=
new
;
sp
(
0
,
0
,
255
);
sp
true
;
<
>
=
new
;
style
=
L"#Context"
;
style
sp
;
.
(
L"#NormalLink"
,
style
);
}
{
<
>
=
new
;
sp
(
255
,
128
,
0
);
sp
true
;
<
>
=
new
;
style
=
L"#Context"
;
style
sp
;
.
(
L"#ActiveLink"
,
style
);
}
}
void
::
(
<
>
,
<
>
)
{
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
if
(!
&&
)
;
}
void
::
(
<
>
,
const
&
)
{
auto
=
.
().
(
);
<
>
=
new
;
(
sp
,
);
if
(
indexDst
!= -
1
)
{
(
sp
,
.
()
indexDst
]
);
}
if
(
indexDst
== -
1
)
{
auto
=
new
;
style
->
sp
;
.
(
,
style
);
}
else
{
.
()
indexDst
]
sp
;
}
FOREACH(Ptr<DocumentStyle>, style, styles.Values())
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
.
());
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
style
);)
{
style
nullptr
;
}
}
void
::
(
<
>
,
const
&
)
{
auto
=
.
().
(
+
L"-Override"
);
if
(
indexSrc
== -
1
)
{
return
;
}
auto
=
.
()[
indexSrc
]->styles;
(
csp
,
);
}
void
::
(
<
>
)
{
(
,
);
(
,
);
(
,
);
(
,
);
(
,
);
}
void
::
(
const
&
)
{
<
>
=
new
;
style
.
;
style
((
double
)
.
,
false
);
style
.
;
style
.
;
style
.
;
style
.
;
style
.
;
style
.
;
(
style
,
);
}
::
::
(
<
>
,
const
&
)
{
;
font
.
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
font
.
=
?
.
() :
.
.
;
=
?
.
() :
.
;
=
?
.
() :
.
;
if
(
)
{
font
.
= (
)(
.
().
?
.
.
*
.
().
:
.
().
);
}
else
{
font
.
=
.
.
;
}
return
(
font
,
color
,
backgroundColor
);
}
::
::
(
const
&
,
const
&
)
{
<
>
;
{
=
.
().
(
);
if
(
index
!=-
1
)
{
selectedStyle
.
()
index
];
}
else
{
selectedStyle
=
[
L"#Default"
];
}
}
if
(!
selectedStyle
)
{
<
>
=
new
;
selectedStyle
sp
;
<
>
;
=
;
while
(
true
)
{
=
.
().
(
currentName
);
if
(
index
== -
1
)
break
;
currentStyle
.
().
(
index
);
currentName
currentStyle
;
(
sp
,
currentStyle
);
}
}
<
>
=
selectedStyle
;
return
(
sp
,
);
}
::
(
bool
)
{
return
([&](
&
)
{
(
writer
,
);
});
}
void
::
(
stream
::
&
,
bool
)
{
for
(
=
0
;
i
<
.
();
i
++)
{
<
>
=
i
];
paragraph
(
,
);
if
(
i
<
.
()-
1
)
{
.
(
L"\r\n\r\n"
);
}
}
}
}
}