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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
::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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>