mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-20 08:39:50 +08:00
@ -186,6 +186,16 @@ bool docx_conversion_context::get_inside_frame() const
|
||||
return inside_frame;
|
||||
}
|
||||
|
||||
void docx_conversion_context::set_scale( const int _scale )
|
||||
{
|
||||
scale_for_framePr = _scale;
|
||||
}
|
||||
|
||||
int docx_conversion_context::get_scale() const
|
||||
{
|
||||
return scale_for_framePr;
|
||||
}
|
||||
|
||||
void docx_conversion_context::set_output_document(package::docx_document * document)
|
||||
{
|
||||
output_document_ = document;
|
||||
|
||||
@ -1011,12 +1011,18 @@ public:
|
||||
|
||||
bool get_inside_frame() const;
|
||||
|
||||
void set_scale( const int _scale );
|
||||
|
||||
int get_scale() const;
|
||||
|
||||
private:
|
||||
|
||||
bool flag_implicit_end = false;
|
||||
|
||||
bool inside_frame = false;
|
||||
|
||||
int scale_for_framePr = 0;
|
||||
|
||||
struct _context_state
|
||||
{
|
||||
bool in_paragraph_ = false;
|
||||
|
||||
@ -266,6 +266,7 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
|
||||
if (Context.get_drop_cap_context().Scale > 0)
|
||||
{
|
||||
CP_XML_ATTR(L"w:lines",Context.get_drop_cap_context().Scale);
|
||||
Context.set_scale( Context.get_drop_cap_context().Scale );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -281,9 +282,14 @@ void paragraph_format_properties::docx_convert(oox::docx_conversion_context & Co
|
||||
CP_XML_ATTR(L"w:after", 0);
|
||||
if ( Context.get_inside_frame() )
|
||||
{
|
||||
int space = Context.get_drop_cap_context().Space > 0 ? Context.get_drop_cap_context().Space : 113;
|
||||
_CP_LOG << "space = " << space << "\n";
|
||||
CP_XML_ATTR(L"w:line", 240 * ( Context.get_drop_cap_context().Scale ) + space);
|
||||
if( Context.get_drop_cap_context().Scale < 5 )
|
||||
{
|
||||
CP_XML_ATTR(L"w:line", 240 * ( Context.get_drop_cap_context().Scale ));
|
||||
}
|
||||
else
|
||||
{
|
||||
CP_XML_ATTR(L"w:line", 240 * ( Context.get_drop_cap_context().Scale ) + 2 * 240);
|
||||
}
|
||||
}
|
||||
else if (Context.get_drop_cap_context().FontSize > 0)
|
||||
{
|
||||
|
||||
@ -1379,7 +1379,8 @@ void text_format_properties::docx_convert(oox::docx_conversion_context & Context
|
||||
if( fontSize > 0 )
|
||||
{
|
||||
needProcessFontSize = false;
|
||||
_rPr << L"<w:sz w:val=\"" << fontSize * Context.get_drop_cap_context().Scale << "\"/>";
|
||||
int scale = Context.get_drop_cap_context().Scale != 1 ? Context.get_drop_cap_context().Scale : Context.get_scale();
|
||||
_rPr << L"<w:sz w:val=\"" << fontSize * scale + (scale < 5 ? 0: 24) << "\"/>";
|
||||
Context.set_inside_frame(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user