100 Commits
Author SHA1 Message Date
Mark Hung f88bb22cc3 tdf#115321, tdf#139065 render emphasismark for pdf export.
Fix the logical mistake: it rendered emphasis mark only
for spaces - that is excatly opposite to what we want.

Change-Id: Id478af269c6cf8ab9a9e1413d19f9b3a3451d59d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147916
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2023-03-13 13:10:35 +00:00
Mark Hung 9e6ff03454 tdf#114556 fix vertical writing emphasis mark position.
1. Calculate emphasis mark offset from base line using
ascender + descender, so it won't be too close or even overlap
with the glyph. It's an approximate for ideographic embox right
or ideographic chraceter face right.

2. CJK Ideographs have different drawing base positions.
Besides, it seems that glyph bound rect isn't consistent among
platforms, so use glyph advance information ( pGlyph->origWidth )
to calculate proper position and center the emphasis mark along
glyph advance axis.

Change-Id: I93676656ed2a1b12a2237a9af94d772879eb7ff7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147748
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2023-03-10 12:42:39 +00:00
Mark Hung 4e6601cf1b tdf#124230 export subTnLst for event triggered nodes.
LibreOffice export all the child nodes of a timenode
to childTnLst. It seems that PowerPoint anticipate there
being fixed starting-time timenodes on childTnLst.
This patch export event-triggered audio time nodes to
subTnLst to make audio playback work. Other node types can
be added in the future once more test cases are found.

Change-Id: Ic96ec50876f568145bdde122d01dec10c1ac7c50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146295
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-29 06:01:05 +00:00
Mark Hung f640a0c5d2 sd/filter/pptx-animations: store condition in NodeContext.
Change-Id: I80cc7209f5347562560590554a8aa9a61e410179
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146294
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-29 05:59:50 +00:00
Mark Hung 55d4dc3a6b sd/pptx-anmiations refactor NodeContext.
Change-Id: I6439882884b3808dec91eaaede50856b0afdd278
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146293
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-28 18:57:59 +00:00
Mark Hung 0a55335ef3 sd/filter/pptx-anmiation refactor Cond class.
Change-Id: Iffb0eeb1454a858987680d402add3f5122f7b6db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146292
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-28 17:44:37 +00:00
Mark Hung 28f3aeff99 sd/source/filter refactor pptx animation export.
Refactor "Any NodeContext::getCondition(bool bBegin) const" to
"const Reference<XAnimationNode>& NodeContext::getNodeForCondition()
const", to get rid of the bool arguement of getCondition.

Change-Id: Ic61d2caecaad2d3ada38556346f66aedb258e554
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146291
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-01-28 17:43:54 +00:00
Mark Hung 88aeb649ed tdf#148630 fix text layout and cursor position for IVS+spacing
in Impress. This involves:

1. SvxFont::QuickGetTextSize() and SvxFont::GetPhysTxtSize():
insert space only when text array value changes. Same value indicates
diffferent characters of the same glyph item (e.x. surrogate pairs,
unicode IVS that is made of a base character and a selector. ).

2. ImpEditEngine::GetChar(): fix a logical mistake that tried
to increase the index by 1 than checking the value of character
position. To advance the index we always need to check the position
first.

Change-Id: I4e3547413ce361ae7801c957e6d589776ebed114
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133102
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-04-20 13:07:31 +02:00
Mark Hung 7418fc8802 tdf#148594 correcting the number of kern spaces.
A glyph item ( or a glyph cluster ) may be made up of
more than one sal_Unicode values ( e.g. CJK ideograph extension
B characters that need surrogate pairs, or unicode iVS that have
a base character and a selector ).

Insert the kern space only when KernArray value changes. I.e.
character belongs to a different glyph item or cluster. Count the
number of needed kern spaces in the same way.

Change-Id: If79766bda37cf4d10ca5be2d51dfdc992eaf9cc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133093
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-04-19 13:51:07 +02:00
Mark Hung 257bb11cbc tdf#148330 fix vertical offset for DFKai-SB (ukai.ttf).
DFKai-SB (ukai.ttf) is a built-in font under tradtional Chinese
Windows. The font is very common, especially for official documents.
It is one of the so-called tricky fonts in FreeType[1].

DFKai-SB has incorrect extent in the glyf table[2]. It results in
incorrect glyph positions in vertical writing.

FreeType recalculates the extents based on the
glyph outline, but LibreOffice uses Harfbuzz with
built-in ot font functions instead of ft (FreeType).

This patch decides if the fix is necessary by
checking the family name of the font and the y-offset
value, and recaculates the glyph offset based on glyph
height and top bearing obtained from the glyph bound rect.

[1]https://freetype.org/freetype2/docs/reference/ft2-base_interface.html#ft_face_flag_tricky
[2]https://github.com/harfbuzz/harfbuzz/issues/3521

Change-Id: If632dd38c462c229837e1efb5446e2142f8f0639
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132511
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-04-08 15:25:37 +02:00
Mark Hung 2b2d1c08c9 tdf#143447 ignore IME candidate window state.
Some traditional Chinese IMEs ( Input Method Editors ) under
Windows10 send WM_IME_NOTIFY with IMN_OPENCANDIDATE but not
IMN_CLOSECANDIDATE. The behavior is different if users configure
the IME and enable "legacy" option.

That caused the cursor been hidden, misled by mbCandidateMode.

The patch ignores the candidate window mode in case the length
of the composition string is 0, assume in that case candidate
window is useless, and resets the candidate window mode when
composition ended to maintain the state as much as we can.

Change-Id: I91a1c23ee1a031313243e032653f50f39b0f2a3c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132512
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-04-08 15:23:54 +02:00
Mark Hung 882045b934 tdf#141671 fix destroyed pargraph style in exported RTF in MSO.
Do not call MoveCharacterProperties() in RtfAttributeOutput
::EndParagraphProperties(). RtfAttributeOutput::ParagraphStyle() has
emited run associated properties defined in paragraph style.
Calling MoveCharacterProperties() again overwrites them.

As this bug is only visible in MS Word, no unit test case is
added.

Change-Id: I6e5bfd12e8afa7dc286ca54448c1ff022aade31d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131848
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2022-03-24 14:04:32 +01:00
Mark Hung 6720e9569d tdf#145322, tdf#144378 fix printing for vertical writing
Printing still uses ExTextOutRenderer to render text because
Skia haven't yet support printing and DWriteTextRenderer can't
bind the printer DC.

ExTextOutRenderer uses win32 API ExtTextOutW. In order to
renderer upright CJK text in vertical writing with that API,
the HFONT created with CreateFontIndirectW needs a font name
prefixed with '@'. OTOH, use '@' prefixed font with Skia break
the vertical writing unit test.

- WinSalGraphics::ImplDoSetFont: use '@' prefixed font name
if the requested font is vertical and is for printing.

- ExTextOutRenderer: use SetTextAlign and text metric tmDescent
to adjust vertical glyphs. It's not consistent with Skia or
DWriteTextRenderer, and is still incorrect in many cases.

The patch is adapted from reverting

commit 5686c1aca4
Author: Mark Hung <marklh9@gmail.com>
Date:   Sun May 2 14:45:45 2021 +0800

    vcl: use DWriteTextRenderer for vertical writing.

Change-Id: Ib2d3df8b68cad4bebe0672c9da0a16b62aed99e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125978
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-12-07 10:52:55 +01:00
Mark Hung a4244c0f05 tdf#144222 fix pdf export with vertical layout
Remove the offset adjustment that is no longer necessary.
That was done in every backend before, and has been
removed now.  We can trust what layout text provides us.

Regression from:

commit dd0d0b44fd
Author: Mark Hung <marklh9@gmail.com>
Date:   Sun May 2 15:12:46 2021 +0800

    vcl: adjust LayoutText() for vertical writing.

Change-Id: I077f5a5f0711444086e56e4469dbcb3010ffe661
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123682
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-10-21 14:13:30 +02:00
Mark Hung d27187b158 vcl:use unique_ptr<SalWinGraphics> in WinSalPrinter
to replace plain SalWinGraphics pointer, and get rid
of delete.

Change-Id: If06df98a8ebfdf5797bddfefa37647522b8e711b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123365
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-10-12 08:34:28 +02:00
Mark Hung 5f84c44e3d tdf#142407 fix incorrect number of lines in vertical writing.
Wrting mode isn't read correctly. The property PROP_WRITING_MODE
contans an Any of sal_Int16. When converting to WritingMode
enum directly, it always get WrtingMode::LR_TB(0), hence use wrong
side to calculate number of grid lines for vertical writing.

The resulted number of grid lines are much smaller than expected,
it ends up leaving large space between header and text.

Change-Id: Ifb0ff09fe981819cc2705de8d5596190f320f79e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123223
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-10-11 14:16:16 +02:00
Mark Hung 8ac8a20ed1 tdf#141957 include the size of header and footer.
Text grid dialog didn't include the size of header and footer,
so if any of them are included, the resulted number of lines or
chars per line was wrong.

Change-Id: I09c1eed1552485adf75ad75cfaf25b99f8eec1e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123215
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-10-11 14:14:13 +02:00
Mark Hung 10ea27faec tdf#142560 handle cached glpyh items in ImplGlyphFallbackLayout
Fallback layout beyond level1 isn't generated because pre-caculated
glyph items does not contain glyph items that needs to fallback, i.e.
when calling ImplLayoutArgs::PrepareFallback. Hence it produce no
maFallbackRuns and maRuns. The patch changes
ImplLayoutArgs::PrepareFallback so that it use pre-caculated glyph
items in the next level to create maRuns to ensure the same fallback
layouts are genrated as layouts generated without pre-caculated glyph
items.

Change-Id: I672f3be6c4915892792b3cb968ad4a325465ccc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117105
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-06-21 13:22:23 +02:00
Mark Hung 8a65d3e9ce vcl: handle fallback glyph offset for vertical writing.
When GenericSalLayout::MoveGlyph() is called from
MultiSalLayout::AdjustLayout(), new position is calculatd
by adding glyph advances ( i.e. glyph items' m_nNewWidth ).

To move the glyph, the moving offset should be calculated
based on the corresponding position, i.e. m_nXOffset v.s.
m_LinearPos.X().

Change-Id: I912d499f49f69f68d8388bc8677e6b47bfb6f066
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115926
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-28 07:03:53 +02:00
Mark Hung 68c1682929 tdf#105650 different strikethrough offset for vertical writing.
Change-Id: I7f1a8753bb00972865625628baeff76ff5dc4699
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115015
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-10 21:15:04 +02:00
Mark Hung 5686c1aca4 vcl: use DWriteTextRenderer for vertical writing.
It's really not possible to support vertical writing with old
ExTextOutW API, use DWriteTextRenderer in this case. This also get rid of
the hacks to prepend '@' in front of the font name when it's for vertical
writing.

Change-Id: Icf594dd248be35fb101d6c1e296971f1acf56e39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115017
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-10 21:14:09 +02:00
Mark Hung f0653d01e1 vcl: vertical writing in WinFontInstance::ImplGetGlyphBoundRect.
Identity matrix isn't enough for vertical writing. For those glyphs
that is vertical, they have to be rotated 90 degrees.

Change-Id: Ia5f1f8ac9cea89aec2c98b88058ec79f733fc238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115148
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-08 06:37:05 +02:00
Mark Hung b35b8079b3 vcl: Rotate glyph in DWriteTextRenderer for vertical writing.
- This is part of the work to make all the text renders
consistently use the positions created from harfbuzz.

- Rotate 90 deg if the glyph is vertical.

Change-Id: I0ef6569cf019ed2cfeec0b7e7b9709a7e8cf8021
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115016
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-08 06:34:31 +02:00
Mark Hung 6c9948d80a vcl: adjust cairo text renderer for vertical writing
, remove extra matrix translation and use the positions
from Harfbuzz more directly.

Change-Id: I2eb337b7f3bd70f4726f56d85a38f4a1f0931155
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115018
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-05 16:06:54 +02:00
Mark Hung dd0d0b44fd vcl: adjust LayoutText() for vertical writing.
Revert 58af692e28 "tdf#111967 translate offsets
so it is relative to vorigin", which use
hb_font_add_glyph_origin_for_direction to change
the origin for vertical writing. This caused major
problem in Y-axis.

For X-axis, align the baseline of the vertical run
to the center of the rotated horizontal run,
by adding "(ascender + descener) / 2.

Besides the alignment mentioned above, underlying text
rendering code should be able to render properly based
on the positions that Harfbuzz API creates.

Change-Id: Ic1ef1f734686d0e61c4b2a6bf7feb7c870bba84f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115014
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-05-05 16:06:15 +02:00
Mark Hung 7a641c71f8 tdf#131634 Don't redo actions created before text edit begins.
In SdrObjEditView::SdrEndTextEdit(), pSdrUndoManager->Redo() was
invoked until all the redo actions created after text edit began
were converted to undo actions.

Without checking, all the redo actions include the ones created
before text edit began were moved to undo stack, and caused the
SdrTextObj to be destroyed in SdrUndoManager::SetEndTextEditHdl
when removing the undo actions and a use after release problem.

The patch add GetRedoActionCountBeforeTextEdit() so the program
won't invoke pSdrUndoManager->Redo() on actions created before
text edit begin.

Change-Id: Ic010bc6e71ee78ef2cb20a5259dc9d6d6579ccaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114102
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-04-16 15:04:07 +02:00
Mark Hung f3f7cc53ef tdf#136956 reorder undo actions in removeColumns
and removeRows.  Inside the removeColumns and removeRows, undo actions
are added first, and then cell spans are updated to reflect the removed
columns or rows. Once undo the cell spans they become immediately
invalid because the rows or columns are already removed, hence cause
Impress to crash.

Change-Id: I9d8641bdad43026eca03cbeaaa3a5907b516304f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112355
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-03-16 15:23:58 +01:00
Mark Hung e630da1ed8 tdf#129940 handle text:ruby element inside text:p
Implement ScXMLCellTextRubyContext for text:ruby.

It creates two types of child elements:
ScXMLCellRubyBaseContext for text:ruby-base,
and ScXMLCellRubyTextContext, for text:ruby-text.

Ruby text isn't used now, but can serve for future
application.

Change-Id: I33b778838032458ffbefc6a2835d2ae59dff30cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110088
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-02-08 14:07:07 +01:00
Mark Hung 9b19bf0283 tdf#128550 set sub item on the ancestor node.
The target of a animation node may resolved to
a subitem. However it only has effect on a
iterate container or animate node, not on any
other containers. Subitem setting like background
and paragraph got ignored, so everything were shown
together.  The patch find the ancestor node
that is iterate container or animate, and set
the subitem on it.

Change-Id: Iaaa52aed3a34eb2d70b3b318b8336246e17e1e98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109444
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-01-20 12:14:21 +01:00
Mark Hung 621c189173 tdf#104927 consider character width for CSV import
dialog in fixed width mode. Postions and column width
in csvgrid.cxx are muliplied by character width to
get X coordinate. Positions are calculated based
on the string length, disregard the fact that the
characters may have different visual width.

Most CJK ideographs and symbols are designed so that
their width are twice of the western characters in
the same font in general.

This patch implement ScImportExport::CountVisualWidth()
to count their visual width, convert the position
so string that contains CJK ideographs render at the
right place, and separate the string based on the
calculated visual width instead of the number of
sal_Unicode chars.

Change-Id: Ic5c1ec219820cf4e1d6c554d5eaccca9f8210ec6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108802
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-01-09 05:13:55 +01:00
Mark Hung 2ffa6c8973 tdf#120171 editeng: don't reduce nBreakPos
even if it is greater then nMaxBreakPos. The only situation
that happens is when there is a hanging punctuation. Reducing
nBreakPos to nMaxBreakPos always break that punctuation to the
next line.

Change-Id: Ie4b61d21f4d8f6f874e2a969260c13a3bca2a049
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108594
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-01-04 13:40:01 +01:00
Mark Hung 326388da4e tdf#138779 do not call EndRun() in StartRuby()
and EndRuby(). Ruby is implemented as EQ field in RTF.
The original run text become the ruby base text in this
case. Calling EndRun() in StartRuby() might cause the
run completed early and text attributes that hasn't be
processed mistakenly applied to next run. This patch
close the in EQ field command in EndRun, in case StartRuby
has already inserted EQ field command.

Change-Id: I3a755f235b79d11b7897f85ae3989cc3ac73b06a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108194
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-12-29 13:55:41 +01:00
Mark Hung 765b13b67e tdf#138937 don't use attributes that depend on preset data
if preset data is not found. Curve, polygon, and free form
motion paths do not have preset data. Create the path
in these cases as well.

Change-Id: Idd3b24b81a15de53e302e8cb7f3636d72e10b4da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108022
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-12-24 14:02:57 +01:00
Mark Hung f97af19460 tdf#137894 separate associated character properties
in ww8filter/RtfAttributeOutput and treat \dbch as
CJK and \hich Western in order to roundtrip the
RTF document.

ww8filter mix all the associated style, including
properties for CJK and CTL scripts.

Both RtfAttributeOutput::CharFontCJK and
RtfAttributeOutput::CharFontCTL output \dbch,
that result in incorrect assocation.

CharFontCTL should use \rtlch, but it was already in
RtfAttributeOutput::MoveCharacterProperties.

To make the order correct, I separate the
associated character properties that were
stored in m_aSyltesAssoc into m_aSyltesAssocRtlch,
and m_aSyltesAssocDbch by their script types.

Note that it is not clear what associated character
properties that we should adopt for \hich and \ltrch.

In theory RTL scripts can output high ANSI chars too,
so \hich may get properties from either Western or
CTL scripts. However, examining Hebrew RTF documents,
I didn't see any sign that \hich is used in that way.

Use RTL as CTL might be a problem for Mongolian,
Manchu and Xibe. They are CTL but top-to-bottom (aka LTR)
. But I don't think they will be expressed
as high ANSI chars either.

Change-Id: I214edbb00a67c2ffe19c5a37254c8988a0828f40
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106355
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-25 09:20:27 +01:00
Mark Hung 8c14adfa76 tdf#138210 check if CustomShapeGeometry exist first.
CustomShapeGeometry does not exist for a text frame. Getting
the property throws an Exception and cause a general IO error.

Change-Id: I0e31780292d45211bfd1250d0d359c72def50583
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105834
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-11-21 02:32:49 +01:00
Mark Hung 5b74b3322f tdf#104378: don't reset para attributes while
converting Chinese characters.

In TextConvWrapper::ChangeText_impl, calls to
EditView::RemoveAttribs() reset the paragraph attributes.
That makes SvxLanguageItem of EE_CHAR_LANGUAGE_CJK become
LANGUAGE_DONTKNOW. Hence it always stops converting after the
first success.

This patch overload EditView::RemoveAttribs() so that it is
possible to clear all character attributes of the selction
without touching paragraph attributes.

Before, bRemoveParaAttribs either removes items between
EE_ITEMS_START and EE_CHAR_END, or removes items between
EE_CHAR_START and EE_CHAR_END. The patch add a new enum
class EERemoveParaAttribsMode, with the following values:

1. RemoveAll : correspond to the old bRemoveParaAttribs = true
2. RemoveCharItems: correspond to the old bRemoveParaAttribs = false
3. RemoveNone: new thing for "don't touch para attributes."

Change-Id: I5132e708dea9e2066f13f1b001bd954d7b477f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104484
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-10-23 15:36:22 +02:00
Mark Hung aa99b57cdc tdf#137594 prevent converting unallocated columns.
Check col against GetAllocatedColumnsCount()
instead of MaxCol(). This prevents allocating
a new column just for converting an empty cell.

Change-Id: I5c8dcfffc2661ab9c4fd9c2c53ed389e57351517
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104528
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20 08:08:42 +02:00
Mark Hung 54e1e5f597 tdf#130314 fix incorrect logic in last commit
Previous commit ( ac76f9e8ad ) contains a logical
mistake. Change && to || there.

Change-Id: Id982ce6f22b0022316b564029f813da9072b71e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104089
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-10-09 14:43:23 +02:00
Mark Hung ac76f9e8ad tdf#130314 space counting for input field.
1. Input field should be counted like other fields,
   with its content expanded with GetExpText().

2. Use only GetLen() instead of rInf.GetLen() in
   SwTextInputFieldPortion::GetExpText() because
   when justifying the text, rInf.GetLen() isn't
   always updated corresponding to rInf.GetIdx().

   ( Check SwTextAdjuster::CalcNewBlock() for ref.)

Change-Id: I6a41275295607887c476fdd3f8e5a90c936c9d31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103782
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-10-08 14:20:49 +02:00
Mark Hung f266feaebe sw/qa: relax testTdf134146 in layout tests.
The old test case expects the number of //text to
be 14. I.e. the Y-axis title splits into exactly two
lines. But it splits into 3 lines in my environment
( Windows10 traditional Chinese version ). Considering
the result might be locale and font dependent, relax the
test case so that it passes as long as the title breaks
into two or more lines.

Change-Id: Ic1da3993c95ecaa7a58d09901a7ce05dd8a34235
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103900
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-10-03 21:51:09 +02:00
Mark Hung 7dcc18b5ac tdf#119223 export the object name for pptx documents.
Originally the name was always an object type plus
an index. That not only ignores the existing
object name, but also makes an unnamed object named
in the roundtrip. So here the object name is used
no matter it is empty or not, to keep unamed object
unamed.

Change-Id: Ib29a8fbc1fd67fa9a4a4efbfd0b2e9c4fb50de0a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96908
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-07-04 06:40:55 +02:00
Mark Hung 4ce833e4ff vcl: allow BitmapFastScaleFilter for 1xN or Nx1 cases.
Limiting both side to be at least 2px is not necessary,
so check for 1px and add test cases.

Change-Id: I3c6f6ed5c8842bf24e7983bd8ed27fb8bb9568c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92117
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2020-06-03 16:18:28 +02:00
Mark Hung 6ab3770544 drawinglayer: refactor GeoTexSvxTiled::iterateTiles
to provide a more generic callback interface and expose
it as public to allow other usage.

Change-Id: I6bc62a05fee750586f7281d8c24f2133884e77ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14 09:28:41 +02:00
Mark Hung 6de9dc3c94 tdf#104225: speedup hit test for FillGraphicPrimitive2D.
Default is to decompose and process the primitive
recursively, but it is not necessary since the shape
is regular. So perform the hit test using getB2DRange()
like FillHatchPrimitive2D or FillGraidentPrimtive2D.

Change-Id: Ie9d91943d2f3502938e41b7f6b0a364d9da15d63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92135
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-14 09:27:31 +02:00
Mark Hung 32c8bd660e tdf#120216 improve svx table performance.
By defining operator== for SdrConnectStyleData and
SdrFrameBorderData, and make a deeper comparison instead
of the pointer stored shared_ptr in SdrFrameBorderPrimitive2D.
The SdrFrameBorderPrimitive2D::operator== always
return false before. The response time of clicking a cell
and then entering editing mode improved from 4s to 0.5s
in my environment.

Change-Id: I625d9f69a07f42cac4a6cba45ec9e1c4195b6d58
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90120
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-06 20:40:17 +01:00
Mark Hung 5f90c8bc02 tdf#130483 prevent pasting cell exceeds the border.
When pasting a table onto another selected table,
cells are cloned from source to target including their
column span and row span. In the test case the
target table can accomodate the first cell of the
merged cells, while the rest go over the table boundary,
hence causing some exception later.

Change-Id: Iae78a9e1689571d4ea2f1ac4853f68c1f7dccb9c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88737
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-15 17:53:02 +01:00
Mark Hung f40456f093 sw/qa: fix libxml2 parser error for testChinese
in htmlexport CUT on Windows with tradtional Chinese
as the system locale.

Libxml2 complaints about encoding:
Entity: line 2: parser error : Input is not proper UTF-8,
indicate encoding !
Bytes: 0xB4 0x49 0xA4 0xE5

- By default SvxHtmlOptions::GetTextEncoding() uses
SvtSysLocale::GetBestMimeEncoding() to decide the decoding,
where osl_getThreadTextEncoding() is used. That results in
big5 if you're using Windows with tradtional Chinese as the
system Locale.

- libxml2 expects the xml begins with "<?xm", and guesses the
encoding based on first 4 bytes of the content. So it always
falls back to utf8 in our test.

Change-Id: I48be9bf552ab6ea76f8baea7e48a8c02a7e8c2cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88260
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-02-10 12:25:03 +01:00
Mark Hung b203b9c83d tdf#128304 export TB_RL writing mode as eaVirt
and import eaVirt to TextWritingMode instead of TextPreRotateAngle
(-90) degree of CustomShapeGeometry. CJK text in TB_RL writing mode
are upright in Writer. It corresponds to eaVirt by its defintion.

Change-Id: I2a8bc6676ad6af06b06e023adaa2f201a028d426
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86637
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-14 10:23:19 +01:00
Mark Hung 340b0eedaa tdf#129655 Sync TextWritingMode to frame direction.
Sync the text writing mode of a shape to the frame
direction of the attached text box ( a text frame ).

Change-Id: Ied9ff1a1d0f53d7ef78a83a086af0a2c1ca5eb36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86638
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-13 16:31:04 +01:00
Mark Hung 8e500c458a sc/qa: revert locale change in the scope guard.
ScExportTest::testTdf112567() and ScExportTest::testTdf112567b()
change the locale config to "hu-HU" and revert to "" at the end,
the resulted locale is the system one instead of English, and
breaks testTdf128976 under a zh-TW build environment because
testTdf128976 relies on some font/loclae dependent metric data.

Change-Id: Iec8a0771a726133dfd30d5e5e254d9b678d44d72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86191
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-01-04 07:07:04 +01:00
Mark Hung d86cfcaf70 tdf#94947 Set preset-id for user defined motion paths.
User defined motion paths ( curve, polygon, freeform line )
did not have preset-id. Set the preset-id so that the
preset type will be highlighted in the custom animation
pane after editing.

"libo-motionpath-curve", "libo-motionpath-polygon",
and "libo-motionpath-freeform-line" are used for the three
user defined motion paths.

This patch is related to tdf#94947, though it doesn't
make the original document display correctly by guessing
the missing preset-id, but it prevent empty preset-id
to be generated when creating those three motion path
animation.

Change-Id: I50c0133bea32e022b07e5d8c0a024810844f124d
Reviewed-on: https://gerrit.libreoffice.org/83079
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-11-30 15:00:09 +01:00
Mark Hung 93161eed83 sd: fix typo maEffectDiscriptorMap -> maEffectDescriptorMap;
Change-Id: Ie0e8dc67969ca680e80c544f954d3bef9adbcb33
Reviewed-on: https://gerrit.libreoffice.org/83078
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-11-30 14:59:22 +01:00
Mark Hung 2971f6bbab tdf#106638 oox: reset font settings if necessary.
Direct formatting was used when symbols were inserted.
However when there wasn't any direct formatting of Latin
fonts in the following runs, it didn't know how to reset
the font. Get the default font with XPropertyState and
try to reset to the default value if symbol fonts are set.

Change-Id: I83c9317ba61a96375128f1cc3ed478d958ddaa5c
Reviewed-on: https://gerrit.libreoffice.org/81956
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-11-10 12:32:24 +01:00
Mark Hung 175ab30395 tdf#98603 export runs with correct lang attribute (2/2).
Obtain lang attribute of rPr element from CharLocale,
CharLocaleAsian, or CharLocaleComplex based on the script
type of exported text.

There are several other call sites of WriteRunProperties,
like those in chartexport, and those for text fields,
Here I leave the default to CharLocale so it fallback
to western locale as it did before.

Change-Id: I33679517dd88f9e415933decc02f10afc807ad3b
Reviewed-on: https://gerrit.libreoffice.org/79973
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-10-10 13:25:32 +02:00
Mark Hung f9569785dd tdf#98603 fix the missing char property (1/2).
- moLang is missed from assignUsed, so the attribute was never processed.
- Set CharLocale, CharLocaleAsian, or CharLocaleComplex based on lang
attribute of rPr (run property).

Change-Id: I6a9a636d790d244d19e7b661a1a63b1249c2bd37
Reviewed-on: https://gerrit.libreoffice.org/79972
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-10-10 05:30:27 +02:00
Mark Hung d744838991 tdf#127422 draw text with correct pKernArray values.
Prior to 5f62b97ae7,

Starting position was specified and DrawText was used to render
the text without referring to pKernArray. After the patch,
DrawTextArray was used but pKernArray was not update correctly.

Instead of draw each substring seprated by space, this patch
increases the values pKernArray when a space is encountered
and call DrawTextArray only once.

Change-Id: I9e61b2d0608400f26136490248740c5f00b56cc3
Reviewed-on: https://gerrit.libreoffice.org/79544
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-09-29 05:44:27 +02:00
Mark Hung 56e95f8e20 tdf#126353 merge character borders on layout portions.
Layout portions / para portions may have portion length.
So merging them is valid and there's no need to check
them at all. Invoke MergeCharacterBorder in InsertPortion
to handle border merging consistently.

Change-Id: I3669bcbb1d658e1df74d338d6cf062e5f07faf4d
Reviewed-on: https://gerrit.libreoffice.org/77366
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-08-20 14:16:55 +02:00
Mark Hung c1c3a3c619 tdf#104922 recover text grid setting properly.
Lines per page and chars per line can not be set before the
max values determined, otherwise we may get incorrect result
because of truncating to incorrect max values.

Change-Id: I9829af0dcfd744f4383a5f9034270b00fdfb15b8
Reviewed-on: https://gerrit.libreoffice.org/73280
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-06-04 06:44:31 +02:00
Mark Hung 16faad3657 tdf#107487 fix font fallback for non-BMP characters.
Non-BMP characters use two sal_Unicodes. It is necessary
to advnace with OUString::iterateCodePoints safely instead of
nCharPos + 1.

Change-Id: Iea1005f05421b1021a9b3ff611439357d4dcba9e
Reviewed-on: https://gerrit.libreoffice.org/73326
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
2019-06-03 04:51:16 +02:00
Mark Hung 966dc7f2cf EPUB export: fix not properly paired openPageSpan
Fix the test case converting abi11105.abw to EPUB file.
( the attachment at
  <https://bugzilla.abisource.com/show_bug.cgi?id=11105#c1> )

soffice.bin: .../sax/source/expatwrap/saxwriter.cxx:1184: virtual void
(anonymous namespace)::SAXWriter::endElement(const rtl::OUString &):
	Assertion `aName ==
	m_pSaxWriterHelper->m_DebugStartedElements.top()' failed.

We used to invoke handlePageSpan when starting a paragraph
or a table element that has master-page-name defined in the referred
style, and invoke closePageSpan when XMLBodyContentContext.

Limit the handling of page span to top-level paragraph or tables
so that it doesn't messed up in the nested ( paragraph that changed
it's page style in a table cell ) case.

Change-Id: Ic8637663aaa7506ced9758bd7ccd7233309e8557
Reviewed-on: https://gerrit.libreoffice.org/73214
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-31 09:12:23 +02:00
Mark Hung 6a7db071c7 tdf#125497 allow backspace to remove CJK IVS.
Japanese users prefer to remove a CJK IVS character
when pressing the backspace instead of removing
the selector part of IVS.

Change-Id: I4313d69ed52d82c5a7e4e4823b1da06f1d90bdad
Reviewed-on: https://gerrit.libreoffice.org/72971
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-05-30 10:58:33 +02:00
Mark Hung 96acebb722 tdf#124937 reset m_pFirstOfBorderMerge before truncate.
SwLinePortion::Truncate() called in
SwTextFormatter::FormatReset() delete the portion referred
by m_pFirstOfBorderMerge.

Change-Id: I68e134c86db617d37ea2efa09dad4409772146b5
Reviewed-on: https://gerrit.libreoffice.org/72300
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-05-18 04:33:35 +02:00
Mark Hung b67fbe0a16 sw/qa: recover locale in testUserFieldTypeLanguage.
In testUserFieldTypeLanguage the locale was set to de-DE
first then revert by calling SetLocaleConfigString with an
empty string when the test finished. Calling
SetLocaleConfigString with an empty string set the system
locale to the system default, which is not necessarily en-US
which is the default for unit tests.

Unfortunately it makes testTdf108021 fail because the
layouts in the testTdf108021 are different in en-US and
zh-TW locale in my environment. This locale-dependent layout
issue is tracked as tdf#125025 now.

Change-Id: I50ae2df5fb4624f94d070742c6189bf333370137
Reviewed-on: https://gerrit.libreoffice.org/71480
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-05-10 13:48:39 +02:00
Mark Hung b593634d3c tdf#124230 pptx: make exported animation sound work.
1. Fix target path for the embedded media. Move the media
file to /ppt/media ( was /media ) and use the relative path
../media for the target path when adding the relation. This
is necessary for MSO to play the sound.

2. Write timenode id for the start or end conditions if the
animation node for the begin event or the end event is
available. Events like BEGIN or END has to refer a timenode.
Without specifying referred timenode in start and end
condition, Impress will not activate the audio node after
importing the document.

Change-Id: I6027be2e836e2f86061e401c8af806b2b1993a49
Reviewed-on: https://gerrit.libreoffice.org/71427
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-04-30 15:03:19 +02:00
Mark Hung bf2f0c9137 tdf#73092 remove remaining shape of the repeating animation.
It is neccessary to set a drawshape to invisible (i.e. remove the
effect ) before the drawshape rewind, otherwise it remains at the
original place. The timenode container will ask its child to remove
the effect after all the child finished, before it start to repeat or
it deactivate.

Change-Id: Iaef1a8269b61afa0c37b03655e2ea169f1d3c453
Reviewed-on: https://gerrit.libreoffice.org/69543
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-03-31 11:38:16 +02:00
Mark Hung 0546af3643 tdf#123909 fix event source that refers to a timenode.
p:tn (see below) were treated as delay value instead of timenode id.

  <p:stCondLst>
    <p:cond evt="begin" delay="0">
      <p:tn val="5"/>
    </p:cond>
  </p:stCondLst>

Just convert the timenode id to XAnimationNode and set
the event source properly.

Change-Id: Ib408be6714c6ac70dad7018e544e560cf59a40c0
Reviewed-on: https://gerrit.libreoffice.org/69340
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-03-20 12:42:02 +01:00
Mark Hung d98d3e2a0b tdf#44223: Export the audio of effects and transitions.
This will allow to round trip the test case for the slide
transition and the animation effect audio.

Change-Id: Iac524e6bbcdb0a29491cfeba63121c845685fd11
Reviewed-on: https://gerrit.libreoffice.org/68540
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-03-04 14:32:15 +01:00
Mark Hung 71755f3639 tdf#123743 deactive after the player is stopped.
The queried media duration for gstreamer isn't ready at the beginning.
Instead of deactivate the audio node immediately after querying the
duration, schedule to update the media duration and use the updated
duration to schedule deactivation.

Change-Id: I8bfa69377fbc18b21baf48bc293d2d0853e8805a
Reviewed-on: https://gerrit.libreoffice.org/68451
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-03-01 00:24:05 +01:00
Mark Hung 4076b7589a tdf#123557 PPTX: Export timenode condition targets.
Refactor the code and reuse WriteAnimationTarget to export
the target element for the condition element in stCondLst
and endCondLst.

Add testTdf123557 to make sure import-export-import works.

As SdOOXMLExportTest2::testTdf90627 no longer produce corupt
pptx that has endCondLst without Cond element, make the
xpath more specific about what is testing.

Update schema because drawooo:enhanced-path incluced in the
test case.

Change-Id: If5d64f5c23aa2652cfa72471f9f7886c7dd956eb
Reviewed-on: https://gerrit.libreoffice.org/68211
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-27 11:11:32 +01:00
Mark Hung 7e18b87566 tdf#88969 restart interactive sequence.
This patch allows the whole interactive sequence to
restart automatically when it's done. User don't
need to insert multiple pause toggle command to
a media object just for toggling the media
multiple times.

Change-Id: I000a55f580917327ae438ea8e79e62f63275cce7
Reviewed-on: https://gerrit.libreoffice.org/68283
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-26 04:57:21 +01:00
Mark Hung 7b04874fc5 tdf#123557 PPTX: import timenode condition targets.
Handle timenode condition properly. Begin and End of
TimenodeContainer allow Sequence, Event, Timing, double,
and VOID. Only events with Source set are valid.

Change-Id: I25519110715072ca36b7f5c55c26415f9fbe9deb
Reviewed-on: https://gerrit.libreoffice.org/68210
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-25 10:32:01 +01:00
Mark Hung df8629e14f sd: fix preset class for media call effects.
Change-Id: I2a2a72a3a19beb9911fa694e983945480029ae0d
Reviewed-on: https://gerrit.libreoffice.org/68276
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-25 01:30:19 +01:00
Mark Hung 7927bfcf46 slideshow: do not toggle pause when deactivate.
The command animation node schdules deactivation immediately after it is
activated, it turns what it might pause shortly then toggle the media to
play again, and it will not possible for user to insert many pause
commands to achieve toggling between play-pause-play-pause.

This commit will revert
1aa10fcb66 tdf#121830 and the follwing
f820f6eb60 tdf#121942

PowerPoint does not play the video file when the slide start. Instead it
insert a pause command in a interaction sequence that is triggered by
clicking the video file. I'm working on tdf#123557 to import start and
end condtions of a time node and tdf#123653 to allow triggering events
by clicking on the video. But there are still some more strange things
in the attachment of tdf#121830 that I have to investigate its start
condition and its media file format to understand whether it really
should play automatically ( or just a bogus file) and why it didn't
play.

Change-Id: I823afb4d1048471cebe43deb597f17a6e2611f06
Reviewed-on: https://gerrit.libreoffice.org/68245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-24 22:12:46 +01:00
Mark Hung a798926550 tdf#123653 pass WM messages to the parent window.
Use cbWndExtra so that MediaPlayerWndProc can get the Window
pointer.

Do not handle mouse event WM messages in MediaPlayerWndProc and
pass them to parent window because Slideshow handles the message
themselvs.

Change-Id: Ie790e06eb3813bc3b63f78f25cf6e1640c58dee2
Reviewed-on: https://gerrit.libreoffice.org/68242
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-24 00:52:28 +01:00
Mark Hung ecdcc847cd tdf#123653 let gstreamer gst video overlay bypass events.
Change-Id: I4a10f1b8b0220c91c41bc9b3bf37024d6ccbaf04
Reviewed-on: https://gerrit.libreoffice.org/68243
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-24 00:52:02 +01:00
Mark Hung a1bf6fa6c4 sd: respect what user has selected for new effects.
It was annoying that "Entry - Appear" animation was always added
despite user had selected another effect. Correct the design as:
- "Entry - Appear" is added for the first animation in the slide.
- Last selected effect is added.
- If the category is selected but the effect isn't, the first effect
  in the category is added.

Change-Id: I5e781feb0468bef4a5e46fd277554ddeadbcfbec
Reviewed-on: https://gerrit.libreoffice.org/67977
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-19 18:25:22 +01:00
Mark Hung cacdb1ae9d tdf#77186 handle time container indefinite repetition.
Indefinite duration isn't necessary for indefinite repetition,
so simply check the number of iteration left and do not decrease
the number when the repetition is indefinite.

Note: a known issue is that the next effect starts before
"until click" or "until next slide" if the starting time of
the next slide is "after previous". A workaround is to set
the starting time of the next slide to "click".

Change-Id: Ie9c73b472dc400bc41501029ff19ecc3e3fab2df
Reviewed-on: https://gerrit.libreoffice.org/67896
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-19 18:25:03 +01:00
Mark Hung 1813841748 avmedia: set gstreamer gst_video_overlay size and position.
Have video fit to the media object size on the slide,
allow more complicated interactions.

Change-Id: Ice1fa4b521176ad7ed7f7d1d2b13e617e8282390
Reviewed-on: https://gerrit.libreoffice.org/67978
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-02-19 09:54:48 +01:00
Mark Hung b295921c4a svx: allow UINameSingular property.
UINameSingular is used in the title of the animation effect.
It was missed in media objects, contorl objects, frames, tables,
etc., causing the title of the animation effect to become just a
number without prefixing object type before it.

Change-Id: I7446d59b1b80102c34b8326e20927f60ad24da25
Reviewed-on: https://gerrit.libreoffice.org/67934
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-19 06:24:49 +01:00
Mark Hung a18bb779e0 sd: fix crashing when adding new effects to media.
Check if the objct has name roperty with hasPropertyByName() before
accessing in case some objects ( media, table, control, etc. ) do not
have name property.

Regression caused by e559d360d0 ( related to tdf#90243 ).

Change-Id: I05fc45c631f8acd3b9ba8c8305d4bc1e31651824
Reviewed-on: https://gerrit.libreoffice.org/67901
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-18 12:39:54 +01:00
Mark Hung 18975274dd tdf#40780 extend default media duration from 0.01s to 0.3s.
Player can only update the duration when the state of the
GStreamer pipeline changes. But GStreamer need some time to get
ready. However the default duration (0.01s) is so short that
the audio node is deactivated before the duration update.
Hence I just pick up a value that is long enough to allow
update happen empirically.

Change-Id: If94133fde09e414bd9ea3c4b162a13d5c70f4524
Reviewed-on: https://gerrit.libreoffice.org/67783
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-15 14:38:28 +01:00
Mark Hung 6b6c0b120f tdf#44223 allow slideshow to play embedded media.
Implement MediaFileManager that create the temp media
file for package urls when making slideshow.

Change-Id: I10a5ddc405928b4322ad72eb603508faf25bf0db
Reviewed-on: https://gerrit.libreoffice.org/67209
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-04 01:15:22 +01:00
Mark Hung 8a1321362a tdf#44223 oox: import embedded media stream.
- Handle cTn and tgtEl of MediaNodeContext.
- Setting the audio source of XAudio.
- Embed the media in TimeNodeTargetElementContext.
- Embed the media in SoundActionContext.
- Allow avmedia::EmbedMedia to embed media from a XInputStream.

Change-Id: I164ac50f97f2036db4bfa2f99adedff0bba382e2
Reviewed-on: https://gerrit.libreoffice.org/67208
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-02-04 01:03:00 +01:00
Mark Hung 916cfdd011 Support new HK variant in Source Han Sans 2.0 and Noto CJK Sans 2.0.
Support HK variant that are newly added to Adobe Source Han Sans
2.0 and Google Noto CJK Sans 2.0 and add missing TC, SC, HW, etc.
in English font names.

Change-Id: I3edccecfd0926d8c11a30bbb5be0debc0f8edf5a
Reviewed-on: https://gerrit.libreoffice.org/66955
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2019-01-26 14:07:07 +01:00
Mark Hung 215a52bee9 Fix warning message if Cygwin GNU Make is used.
Update url according to LODE current version (4.2.1) because
the previous one does not support mkdir -p, which is used
by libcdr and libqxp now.

Change-Id: I7e50e46d2101a3cbd757d683f2d3550f896fc750
Reviewed-on: https://gerrit.libreoffice.org/65882
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-07 14:07:43 +01:00
Mark Hung fff34169fa tdf#70851 fix strange waveline polygon.
::basegfx::utils::createWaveline was invoked with incorrect
parameter, resulted in wavelines rendered along a 4-sided
rectangle instead of a line.

Change-Id: I30f52c95bdb4f804438b04559ba339ba95dee6e1
Reviewed-on: https://gerrit.libreoffice.org/62838
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-06 00:15:09 +01:00
Mark Hung 13b4c191cb tdf#37636 Render textlines with colors.
Create a new helepr class, TextLinesHelper, to handle
textline colors and overall size.

Change-Id: I8635199819443429f7be1754a298e9a21ef17f8c
Reviewed-on: https://gerrit.libreoffice.org/62832
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 13:16:01 +01:00
Mark Hung 8abe2d0ff1 tdf#37636: pass bNormalText to cppcanvas::internal::TextRenderer.
so that we know whether we are rendering a normal text or othewise
(like shadow, etc.) because it is not necessary to use the textline
color or overline color when rendering the shadow.

Change-Id: I51c21bbb4e3cec226320b46e2cdba4cd5e8792d6
Reviewed-on: https://gerrit.libreoffice.org/62831
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:33:27 +01:00
Mark Hung b0da1ca2d7 tdf#37636 create underlines, overlines, strikeout separately
and expose a new cppcanvas::tools::createTextLinesPolyPolygon
interace to fetch them in order to fill each of them with their
own color later.

Change-Id: I26e99a9af87a69d9cb71cda6a4c03c4ba42158dc
Reviewed-on: https://gerrit.libreoffice.org/62830
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:20:41 +01:00
Mark Hung 9709061a57 tdf#37636 take care of MetaOverlineColorAction in mtfrenderer.
Keep the overline color in DevOutState so that it can be
used in text actions later.

Change-Id: Ia584de9b78e1adf6862c09fb50cbed1f16e2ad0b
Reviewed-on: https://gerrit.libreoffice.org/62829
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 12:20:15 +01:00
Mark Hung 19e004ed1c cppcanvas::mtfrenderer refactor
to get rid of one of the initEffectLinePolyPolygon we used.

Change-Id: I04c6e1dc72e1f3936bfd268a3b1092bdc4a9b199
Reviewed-on: https://gerrit.libreoffice.org/62828
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-05 11:38:58 +01:00
Mark Hung 7d571ce795 offapi: update XCanvas::createFont parameter description.
Recognized parameters of aExtraFontProperties were not implemented as
documented. Update the document to reflect current implementation.

Change-Id: I001beb8843161c7633830b7ec64a79695ea0f091
Reviewed-on: https://gerrit.libreoffice.org/62510
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-02 06:14:17 +01:00
Mark Hung beaba5f1ab tdf#43671 set emphasis mark of vcl::Font (opengl).
Change-Id: Ib61765b495c867bcb461ee7324eb7b92ed4da864
Reviewed-on: https://gerrit.libreoffice.org/62631
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-01 14:28:00 +01:00
Mark Hung 17cd7dd708 tdf#43671 set emphasis mark of vcl::Font (windows).
Process extra font properties of the canvas font to
set emphasis mark when creating vcl::Font.

Change-Id: I18ea1aecdde92ed3c777b0db27fcee7976e88476
Reviewed-on: https://gerrit.libreoffice.org/62245
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-11-01 14:27:31 +01:00
Mark Hung 144416c428 tdf#43671 creatCanvasFont with EmphasisMark.
Change-Id: I8c7592e9bdb212fcbb07655e81faadd07ed880f7
Reviewed-on: https://gerrit.libreoffice.org/62244
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-31 00:28:33 +01:00
Mark Hung ae9f37ba75 tdf#100236 Implement linestyles with dash and dots.
Allow append dashes to have dash and dot line styles.
Segment length parameters were taken from cppcanvas, also restructure
the code to use the same appendDashes function.

Change-Id: I17c0796dbe722c4c6d5e91d0e318570a52a2514c
Reviewed-on: https://gerrit.libreoffice.org/62084
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-23 00:55:50 +02:00
Mark Hung d2aee5ab5a tdf#70851 render wave underlines in slideshow.
Change-Id: I31b2717e60b5eae6c992e27700e589938764957c
Reviewed-on: https://gerrit.libreoffice.org/62035
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22 17:09:55 +02:00
Mark Hung c13f0a62fb tdf#100236 implement waveline in mtfrenderer.
Create B2DPolygon with ::basegfx::utils::createWaveline
to render the waveline. Parameters are adapted from
the drawinglayer. Thickness of the line isn't really
implemented yet.

Change-Id: I74d05744632d5d54e439a2a3e144fa2daf4ae1bb
Reviewed-on: https://gerrit.libreoffice.org/61947
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22 17:09:36 +02:00
Mark Hung 226f397174 drawinglayer: fix bold dash dash dot overline in Impress.
Change-Id: Ie3fa48a6ff5cf602b1cd661e3e4053a001a4470f
Reviewed-on: https://gerrit.libreoffice.org/62083
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-22 17:08:39 +02:00
Mark Hung a1b9f7e81a tdf#120573 export media type for .wav properly.
Only video files were handled before. .wav files had
wrong mime type in [Content Types].xml, used videoFile
tag in slide1.xml, and incorrect type in rel file.

Change-Id: I92bded52eb9f366103a10334c6a92fda9648076e
Reviewed-on: https://gerrit.libreoffice.org/61885
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
2018-10-18 14:47:44 +02:00