#include "GuiDocumentEditor.h"
namespace
{
namespace
{
using
namespace
collections
;
namespace
document_operation_visitors
{
class
:
public
,
public
::
{
public
:
<
::
>
;
&
;
;
;
(
&
,
<
::
>
,
,
)
:runRanges(
)
, package(
)
, start(
)
, end(
)
{
}
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
.
()];
if
(
range
.
<=
&&
<=
range
.
)
{
subRun
(
this
);
break
;
}
}
}
void
(
*
)
override
{
}
void
(
DocumentStylePropertiesRun
*
)
override
{
(
);
}
void
(
DocumentStyleApplicationRun
*
)
override
{
(
);
}
void
(
*
)
override
{
.
(
);
}
void
(
*
)
override
{
}
void
(
DocumentEmbeddedObjectRun
*
)
override
{
}
void
(
*
)
override
{
(
);
}
};
}
using
namespace
document_operation_visitors
;
namespace
{
<
::
>
(
*
,
&
,
,
,
)
{
auto
=
<
::
>();
package
=
;
{
(
,
package
,
,
);
->
(&
visitor
);
}
<
>
,
;
FOREACH(Ptr<DocumentHyperlinkRun>, run, package->hyperlinks)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
<
>>&
= ::
vl
::
collections
::
(
package
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
<
>
;
__foreach_iterator__
.
(
run
);)
{
auto
=
run
.
()];
if
(
package
== -
1
||
range
.
<
package
)
{
package
=
range
.
;
startRun
run
;
}
if
(
package
== -
1
||
range
.
>
package
)
{
package
=
range
.
;
endRun
run
;
}
}
while
(
startRun
)
{
=
startRun
.
()].
;
if
(
pos
==
0
)
break
;
auto
=
<
::
>();
(
,
newPackage
,
pos
-
1
,
pos
);
->
(&
visitor
);
if
(
newPackage
.
() ==
0
)
break
;
auto
=
newPackage
0
];
if
(
startRun
!=
newRun
)
break
;
auto
=
newRun
.
()];
package
.
(
newRun
);
package
=
range
.
;
startRun
newRun
;
}
=
].
;
while
(
endRun
)
{
=
endRun
.
()].
;
if
(
pos
==
length
)
break
;
auto
=
<
::
>();
(
,
newPackage
,
pos
,
pos
+
1
);
->
(&
visitor
);
if
(
newPackage
.
() ==
0
)
break
;
auto
=
newPackage
0
];
if
(
endRun
!=
newRun
)
break
;
auto
=
newRun
.
()];
package
.
(
newRun
);
package
=
range
.
;
endRun
newRun
;
}
return
package
;
}
}
}
}