This commit is contained in:
Elena.Subbotina
2022-06-24 14:23:44 +03:00
parent 41a4eedb63
commit b48e6d508d
3 changed files with 22 additions and 1 deletions

View File

@ -1801,7 +1801,7 @@ void XlsConverter::convert_blip(std::vector<ODRAW::OfficeArtFOPTEPtr> & props)
id += 3000;
std::wstring rId = xlsx_context->get_mediaitems().find_image(id , target, isIternal);
xlsx_context->get_drawing_context().set_fill_texture(target);
xlsx_context->get_drawing_context().set_picture(target);
}break;
case ODRAW::pibName:
{

View File

@ -885,6 +885,9 @@ void xlsx_drawing_context::end_drawing(_drawing_state_ptr & drawing_state)
{
drawing_state->type = external_items::typeImage;
if (!drawing_state->fill.picture_target.empty())
drawing_state->fill.texture_target = drawing_state->fill.picture_target;
if (!drawing_state->fill.texture_target.empty())
{
bool isIternal = false;
@ -2879,6 +2882,22 @@ void xlsx_drawing_context::set_fill_texture(const std::wstring & str)
current_drawing_states->back()->fill.texture_mode = textureStretch;
}
}
void xlsx_drawing_context::set_picture(const std::wstring & str)
{
if (current_drawing_states == NULL) return;
if (current_drawing_states->empty()) return;
if (str.empty()) return;
if (false == current_drawing_states->back()->fill.picture_target.empty()) return;
current_drawing_states->back()->fill.picture_target = str;
if (current_drawing_states->back()->fill.type == fillUndefined)
{
current_drawing_states->back()->fill.type = fillTexture;
current_drawing_states->back()->fill.texture_mode = textureStretch;
}
}
void xlsx_drawing_context::set_picture_crop_top (double val)
{
if (current_drawing_states == NULL) return;

View File

@ -281,6 +281,7 @@ public:
double angle = 0;
std::wstring texture_target;
std::wstring picture_target;
double texture_crop[4];
bool texture_crop_enabled = false;
_texture_mode texture_mode;
@ -418,6 +419,7 @@ public:
void set_picture_contrast (int val);
void set_picture_biLevel (int val);
void set_picture_transparent(int nColor, const std::wstring & sColor);
void set_picture (const std::wstring & str);
void set_rotation (double val);