#include "GuiDocumentEditor.h"
namespace
{
namespace
{
using
namespace
collections
;
using
namespace
document_editor
;
namespace
document_operation_visitors
{
class
:
public
,
public
::
{
public
:
<
>
;
(
<
>
)
:clonedRun(
)
{
}
void
(
<
>
)
{
if
(
)
{
.
(
);
}
;
}
void
(
*
)
override
{
<
>
=
new
;
cloned
text
->
text
;
cloned
;
}
void
(
DocumentStylePropertiesRun
*
)
override
{
<
DocumentStylePropertiesRun
>
=
new
DocumentStylePropertiesRun
;
cloned
(
->
);
(
cloned
);
}
void
(
DocumentStyleApplicationRun
*
)
override
{
<
DocumentStyleApplicationRun
>
=
new
DocumentStyleApplicationRun
;
cloned
->
;
(
cloned
);
}
void
(
*
)
override
{
<
>
=
new
;
cloned
->
;
cloned
->
;
cloned
->
;
cloned
->
;
(
cloned
);
}
void
(
*
)
override
{
<
>
=
new
;
cloned
->
;
cloned
=
->
;
cloned
->
;
cloned
=
->
;
cloned
->
;
cloned
;
}
void
(
DocumentEmbeddedObjectRun
*
)
override
{
<
DocumentEmbeddedObjectRun
>
=
new
DocumentEmbeddedObjectRun
;
cloned
->
;
cloned
;
}
void
(
*
)
override
{
<
>
=
new
;
cloned
->
;
(
cloned
);
}
};
}
using
namespace
document_operation_visitors
;
namespace
document_operation_visitors
{
class
CloneRunRecursivelyVisitor
:
public
,
public
::
{
public
:
<
>
;
&
;
;
;
bool
;
CloneRunRecursivelyVisitor
(
&
,
,
,
bool
)
:runRanges(
)
, start(
)
, end(
)
, deepCopy(
)
{
}
void
(
*
)
{
0
;
=
];
if
(
range
.
<=
&&
<=
range
.
)
{
if
(
<=
range
.
&&
range
.
<=
&& !
)
{
;
}
else
{
<
>
=
(
).
<
>();
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
);
if
(
)
{
containerRun
.
(
);
}
}
containerRun
;
}
}
}
void
(
*
)
override
{
0
;
=
];
if
(
range
.
<
&&
<
range
.
)
{
if
(
<=
range
.
&&
range
.
<=
)
{
if
(
)
{
(
);
}
else
{
;
}
}
else
{
<
>
=
new
;
=
>
range
.
?
:
range
.
;
=
<
range
.
?
:
range
.
;
if
(
copyStart
<
copyEnd
)
{
textRun
text
->
text
.
(
copyStart
-
range
.
,
copyEnd
-
copyStart
);
}
textRun
;
}
}
}
void
(
DocumentStylePropertiesRun
*
)
override
{
(
);
}
void
(
DocumentStyleApplicationRun
*
)
override
{
(
);
}
void
(
*
)
override
{
(
);
}
void
(
*
)
override
{
0
;
=
];
if
(
range
.
<
&&
<
range
.
)
{
if
(
)
{
(
);
}
else
{
;
}
}
}
void
(
DocumentEmbeddedObjectRun
*
)
override
{
0
;
=
];
if
(
range
.
<
&&
<
range
.
)
{
if
(
)
{
(
);
}
else
{
;
}
}
}
void
(
*
)
override
{
(
);
}
};
}
using
namespace
document_operation_visitors
;
namespace
{
<
>
(
<
>
)
{
if
(!
)
return
nullptr
;
<
>
=
new
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
newStyle
;
return
newStyle
;
}
<
>
(
*
)
{
(
0
);
->
(&
visitor
);
return
visitor
.
;
}
<
>
(
<
*>&
,
const
&
)
{
<
>
=
new
;
textRun
;
(
textRun
);
for
(
=
.
() -
1
;
i
>=
0
;
i
--)
{
i
]->
(&
visitor
);
}
return
visitor
.
;
}
<
>
(
*
,
&
,
,
,
bool
)
{
CloneRunRecursivelyVisitor
(
,
,
,
);
->
(&
visitor
);
return
visitor
.
;
}
}
}
}