Commit Graph

1216 Commits

Author SHA1 Message Date
Julien Nabet
2a65bf32ec Revert "Typo: iff->if"
This reverts commit cf92da3d6e.

iff can mean "if and only if" so not a typo
2015-06-23 20:42:27 +02:00
Julien Nabet
cf92da3d6e Typo: iff->if
Change-Id: I3fc60856b5a56e71d70b55c89323be074bdec3b3
2015-06-23 20:30:11 +02:00
Michael Stahl
ca6667f8de sw: dump ruby text in nodes dump
Change-Id: Iae673ac8ed8e5817efefd665dbf5f061e80f94bc
2015-06-18 00:36:28 +02:00
Michael Stahl
894ce91bfd sw: fix duplicate whichId attributes in node dump
Change-Id: I5089ce8e13d26dcc773f63b3a6f0ef17474444e0
2015-06-18 00:36:28 +02:00
Michael Stahl
fae87e03ea tdf#91228: need to check the format's IsLockModified(), not the node's
commit 9f01951b85 also did the extra
Remove/Add for Draw fly objects, and it turns out that that's actually
wrong because SwTextFlyCnt::SetAnchor() will set the anchor without
locking anything if it's a Draw object.  Replace it with a different
hack in SetAnchor() that applies only if it calls LockModify().

Thanks to Varun Dhall for creating a reproducer document.

Not sure if the LockModify() could be replaced completely, perhaps it's
just an optimization to avoid re-creating layout frames for the fly.

Change-Id: Ib3236f289c2c4202d48ac378a53ce02130d4ce2c
2015-06-12 17:55:47 +02:00
Stephan Bergmann
b2c8ea3a02 loplugin:cstylecast: deal with remaining pointer casts
Change-Id: I8d27ae80d209159690182ab91e272cf00e9f863d
2015-06-08 16:28:47 +02:00
Philippe Jung
9f01951b85 tdf#91228 Fix Writer crash
Start Writer, Insert Image, Anchor as character, Go after
image, press enter, writer crash

This is because m_pAnchoredFly is not updated.

JoinPrev, JoinNext and SplitContentNode all rely on CutText with calls
InsertHint. InsertHint calls SetAnchor. SetAnchor calls Modify callback
except if "LockModify"ed. This patch ensures that, whatever the value of
LockModify, the references are kept correct.

Change-Id: Id7254784c6954db4b542b2c4228b388fb924bbc2
Reviewed-on: https://gerrit.libreoffice.org/16041
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-02 22:07:30 +00:00
Noel Grandin
5b87ff4085 loplugin:loopvartoosmall
Change-Id: Ieac705a950237ad52a3768f7b7fff5807c6dbb47
2015-06-02 15:07:26 +02:00
Michael Stahl
54a6e4841c sw: SwTxtNode::CutImpl(): destination must be different node
Remove more dead code.:

Change-Id: I9572228be0e5393351a7d22eb23e1f188423a219
2015-06-01 15:50:39 +02:00
Michael Stahl
38e5251a82 sw: SwTxtNode::CutImpl(): destination must be in same SwDoc
Change-Id: I541dad26125bcd98e9c74016ecd03cd7f8bc71e6
2015-06-01 15:50:39 +02:00
Michael Stahl
5dc453ac90 sw: SwTxtNode::CutText() requires a destination
Remove dead code.

Change-Id: Ib6a75718d411effe87d59d30420e2e9d7f15984e
2015-06-01 15:50:39 +02:00
Caolán McNamara
afe5672fbc cppcheck: noExplicitConstructor
Change-Id: I27c24d3284a8e0678fc5c041426b4a7e71cbd363
2015-05-27 13:54:54 +01:00
Christian Lohmaier
ab465b90f6 bin/rename-sw-abbreviations.sh
renames the most annoying abbreviations in Writer (and partially
in the shared code too).

Change-Id: I9a62759138126c1537cc5c985ba05cf54d6132d9
2015-05-20 13:05:49 +02:00
Noel Grandin
6586da0631 fiX OSX build
Change-Id: I5dafc2c8a76356a7bbb258ec9563085d8f2b05cc
2015-05-20 11:42:44 +02:00
Noel Grandin
b253d2bb93 fix OSX build
Change-Id: I5f2ce7043802963c5fa41f0710c176a270e2d23b
2015-05-20 11:01:57 +02:00
Noel Grandin
7a0af37989 convert SAL_LAYOUT flags to scoped enum
Change-Id: I0aeea1f32136e43e90a1afb0ea84dbaff2b77587
2015-05-20 09:52:08 +02:00
Noel Grandin
19a32ddfd2 convert KERNING_ constants to scoped enum
Change-Id: I58031485aaa9ebdeb986a3ee0376f36a9f667947
2015-05-14 12:00:40 +02:00
Miklos Vajna
3c0805e1f4 tdf#86639 SwEditShell: when setting para style, reset char attrs if needed
The old internal RTF filter used to call SwTxtNode::SetAttr() without
setting SetAttrMode::NOFORMATATTR, so character attributes which cover
the whole node got converted to paragraph attributes.  The new UNO
filter goes through SwXText::insertTextPortion(), which sets
SetAttrMode::NOFORMATATTR, so this doesn't happen. The result of this is
that when the UI sets a new paragraph style on the text node, then such
character attributes are no longer removed.

Given that in RTF you can't really have character properties on a
paragraph, going back to the document model produced by the old internal
filter doesn't sound like the good direction -- not to mention that
changing SwXText::insertTextPortion() this way would be an implicit API
change.

Fix the problem by tweaking SwEditShell::SetTxtFmtColl() instead, so
that it removes these full-text-node character attributes, too. The
logic in SwTxtNode::RstTxtAttr() can be extended later if necessary to
delete more attributes, but to be on the safe side, just handle the bare
minimum necessary to fix the problem for now.

Change-Id: I5faa3226fc0f9c18e005da185fe0830d8c393256
2015-05-14 11:39:16 +02:00
Stephan Bergmann
80c2dfa225 loplugin:cstylecast: nop between pointer types of exactly same spelling
Change-Id: I0e42e757a6f7b0c28758193aad8b3cb01607b8b1
2015-05-11 12:51:13 +02:00
Noel Grandin
fc9e78c788 sw,sc,sd,starmath: convert to vcl::RenderContext
Change-Id: I5d0a3b8ed1c49ba2806e0fa528d908da45afd58c
2015-05-11 09:17:41 +02:00
Michael Stahl
e07feb9457 sw: fix assert with frames anchored in redlines on rhbz490395-1.odt
SwRangeRedline::Show() will move nodes around in the nodes-array, which
means that using SwNodeIndex as a key in a map that has a lifetime
not limited by the stack is a bad idea, as the map will become unsorted.

Remove SwFrmFmtAnchorMap from SwDoc and replace it with new
SwNode::m_pAnchoredFlys to do the same mapping.

(regression from 738fb2ad77)

Change-Id: I396d92b9d0b2045e98bad6d0b374303cd4e62b59
2015-05-09 11:02:26 +02:00
Caolán McNamara
520400e8fa convert EXPAND constants to scoped enum
Change-Id: I98a0fecf15337db729b39b80aa9c664abcdd3daa
2015-05-08 13:18:07 +01:00
Stephan Bergmann
8cafd08278 Use typed Timer::SetTimeoutHdl Link
Change-Id: Iaaf0c93e5b28c0f7dbe4f02eda8beeae30708100
2015-05-05 10:21:54 +02:00
Noel Grandin
259820af71 loplugin:staticmethods
Change-Id: I90dd921077bbfc57200e398e7959306f26c65cfe
2015-05-05 09:30:41 +02:00
Stephan Bergmann
3ead3ad52f Gradually typed Link
Turn the Link class into a template abstracting over the link's argument and
return types, but provide default template arguments that keep the generic,
unsafe "void* in, sal_IntPtr out" behvior.  That way, individual uses of the
Link class can be updated over time.

All the related macros are duplicated with ..._TYPED counterparts, that
additionally take the RetType (except for LINK_TYPED, which manages to infer the
relevant types from the supplied Member).

(It would have been attractive to change the "untyped" LinkStubs from taking a
void* to a properly typed ArgType parameter, too, but that would cause
-fsanitize=function to flag uses of "untyped" Link::Call.)

Change-Id: I3b0140378bad99abbf240140ebb4a46a05d2d2f8
2015-04-30 10:20:00 +02:00
Michael Meeks
e8b97a52c9 Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.

Conflicts:
	accessibility/source/extended/accessiblelistbox.cxx
	accessibility/source/standard/vclxaccessiblecombobox.cxx
	accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
	accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
	accessibility/source/standard/vclxaccessiblelistbox.cxx
	accessibility/source/standard/vclxaccessibletextfield.cxx
	basctl/source/basicide/basidesh.cxx
	cui/source/inc/chardlg.hxx
	cui/source/tabpages/tpbitmap.cxx
	dbaccess/source/ui/dlg/UserAdmin.cxx
	dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
	extensions/source/propctrlr/propertyeditor.hxx
	extensions/source/scanner/sanedlg.cxx
	filter/source/pdf/impdialog.cxx
	include/sfx2/mgetempl.hxx
	include/sfx2/sidebar/SidebarToolBox.hxx
	include/sfx2/viewsh.hxx
	include/svtools/brwbox.hxx
	include/svtools/filectrl.hxx
	include/svtools/scrwin.hxx
	include/svx/dlgctrl.hxx
	include/svx/sidebar/Popup.hxx
	include/svx/sidebar/PopupContainer.hxx
	include/svx/sidebar/PopupControl.hxx
	include/svx/sidebar/SidebarDialControl.hxx
	include/svx/sidebar/ValueSetWithTextControl.hxx
	sc/source/ui/condformat/condformatdlgentry.cxx
	sc/source/ui/navipi/navipi.cxx
	sc/source/ui/sidebar/CellBorderStyleControl.hxx
	sd/source/ui/animations/CustomAnimationDialog.cxx
	sd/source/ui/inc/DrawViewShell.hxx
	sd/source/ui/inc/Ruler.hxx
	sd/source/ui/inc/SlideSorter.hxx
	sd/source/ui/inc/ViewTabBar.hxx
	sd/source/ui/inc/Window.hxx
	sd/source/ui/inc/morphdlg.hxx
	sd/source/ui/inc/sdpreslt.hxx
	sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
	sd/source/ui/sidebar/LayoutMenu.hxx
	sd/source/ui/sidebar/MasterPagesSelector.hxx
	sd/source/ui/sidebar/NavigatorWrapper.hxx
	sd/source/ui/sidebar/PanelBase.hxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
	sd/source/ui/slideshow/showwindow.hxx
	sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
	sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
	sd/source/ui/view/ViewShellBase.cxx
	sd/source/ui/view/drviewsa.cxx
	sfx2/source/appl/fileobj.hxx
	sfx2/source/appl/opengrf.cxx
	sfx2/source/control/thumbnailviewacc.hxx
	sfx2/source/dialog/securitypage.cxx
	sfx2/source/dialog/templdlg.cxx
	sfx2/source/doc/docinsert.cxx
	sfx2/source/doc/guisaveas.cxx
	sfx2/source/inc/alienwarn.hxx
	sfx2/source/sidebar/Deck.cxx
	sfx2/source/sidebar/Deck.hxx
	sfx2/source/sidebar/DeckTitleBar.cxx
	sfx2/source/sidebar/DeckTitleBar.hxx
	sfx2/source/sidebar/MenuButton.cxx
	sfx2/source/sidebar/MenuButton.hxx
	sfx2/source/sidebar/Panel.cxx
	sfx2/source/sidebar/Panel.hxx
	sfx2/source/sidebar/PanelTitleBar.hxx
	sfx2/source/sidebar/SidebarDockingWindow.hxx
	sfx2/source/sidebar/SidebarToolBox.cxx
	sfx2/source/sidebar/TabBar.hxx
	sfx2/source/sidebar/TabItem.cxx
	sfx2/source/sidebar/TabItem.hxx
	sfx2/source/sidebar/TitleBar.hxx
	sfx2/source/toolbox/imgmgr.cxx
	starmath/inc/edit.hxx
	starmath/inc/smmod.hxx
	starmath/qa/cppunit/test_starmath.cxx
	starmath/source/edit.cxx
	starmath/source/smmod.cxx
	svtools/source/brwbox/brwbox1.cxx
	svtools/source/brwbox/datwin.hxx
	svtools/source/contnr/fileview.cxx
	svtools/source/contnr/simptabl.cxx
	svtools/source/control/filectrl.cxx
	svtools/source/control/valueimp.hxx
	svx/inc/GalleryControl.hxx
	svx/source/dialog/dlgctrl.cxx
	svx/source/dialog/swframeexample.cxx
	svx/source/fmcomp/fmgridif.cxx
	svx/source/gallery2/GalleryControl.cxx
	svx/source/sidebar/EmptyPanel.hxx
	svx/source/sidebar/area/AreaPropertyPanel.hxx
	svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
	svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
	svx/source/sidebar/insert/InsertPropertyPanel.cxx
	svx/source/sidebar/insert/InsertPropertyPanel.hxx
	svx/source/sidebar/line/LinePropertyPanel.hxx
	svx/source/sidebar/line/LineWidthControl.cxx
	svx/source/sidebar/line/LineWidthControl.hxx
	svx/source/sidebar/line/LineWidthValueSet.hxx
	svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
	svx/source/sidebar/possize/SidebarDialControl.cxx
	svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
	svx/source/sidebar/text/TextPropertyPanel.hxx
	svx/source/sidebar/tools/PopupContainer.cxx
	svx/source/sidebar/tools/PopupControl.cxx
	svx/source/sidebar/tools/ValueSetWithTextControl.cxx
	svx/source/svdraw/svdfmtf.hxx
	svx/source/svdraw/svdibrow.cxx
	svx/source/tbxctrls/colrctrl.cxx
	svx/source/tbxctrls/tbcontrl.cxx
	sw/source/ui/dbui/mmaddressblockpage.cxx
	sw/source/ui/dialog/uiregionsw.cxx
	sw/source/ui/index/cnttab.cxx
	sw/source/uibase/inc/drpcps.hxx
	sw/source/uibase/sidebar/PageColumnControl.hxx
	sw/source/uibase/sidebar/PageMarginControl.hxx
	sw/source/uibase/sidebar/PageOrientationControl.hxx
	sw/source/uibase/sidebar/PagePropertyPanel.hxx
	sw/source/uibase/sidebar/PageSizeControl.hxx
	sw/source/uibase/uiview/view2.cxx
	sw/source/uibase/utlui/navipi.cxx
	vcl/inc/svdata.hxx
	vcl/source/control/combobox.cxx
	vcl/source/control/lstbox.cxx
	vcl/source/window/dockwin.cxx
	vcl/source/window/winproc.cxx

Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
2015-04-28 15:08:48 +01:00
Stephan Bergmann
746a717ed4 loplugin:simplifybool
Change-Id: Ic90d247e6c8e36e27ff444ace10fd37e06d46b50
2015-04-24 12:36:29 +02:00
Michael Stahl
135e4d5c73 related: tdf#90820 refactor SwFrm destruction
Move all logic out of destructors, so it cannot happen any more that
members of a sub-class are accessed from a superclass destructor, when
those members are already dead.

Logic is now in virtual DestroyImpl() methods.

All SwFrms must be deleted with SwFrm::DestroySwFrm().

Change-Id: Icec5b12e12d5a2d955cb5844d7d4f7ac85ab79cd
2015-04-24 12:22:01 +02:00
Miklos Vajna
d31d038f4e SwTxtAttr::dumpAsXml: show hyperlink URLs
Change-Id: Ie887db2793a8bc85a6cd381db7543436bbd5a9d5
2015-04-21 18:28:16 +02:00
Noel Grandin
a7b7c64afc convert SCRIPTTYPE_ constants to scoped enum
Change-Id: I5be3980ac865162d8d7626556ca47eca4b0ee433
Reviewed-on: https://gerrit.libreoffice.org/15344
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-04-17 07:21:08 +00:00
Noel Grandin
58a43332b3 wrap more stuff in VclPtr
Change-Id: I2f0d8a4fe426d8ee1ac55a05ae8dd0b44f9aab2b
2015-04-10 13:01:47 +01:00
Noel Grandin
90dc63a8dd convert SHADOW_ constants to enum class
Change-Id: I1d3c144b2438776a31a246a2d0d4fe57b0caeaa3
2015-04-08 09:07:08 +02:00
Noel Grandin
4b66829390 convert BOX_LINE and BOXINFO_LINE to enum class
since their usage is intertwined.

Also introduce new o3tl utilities enumrange and enumarray to make
working with scoped enums a little simpler.

Change-Id: I2e1cc65dd7c638e59f17d96dfae504747cad6533
2015-04-01 09:36:19 +02:00
Stephan Bergmann
574bc065a7 Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I091e11ab1e7fbacf04a0eac51262d22d3835ab17
2015-04-01 08:41:44 +02:00
Michael Stahl
b9782a2b59 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-31 20:08:35 +02:00
Stephan Bergmann
4a69849e2f Reduce to static_cast any reinterpret_cast from void pointers
Change-Id: I83594c8b6cb1f317b55fe048111edd23f622e1ed
2015-03-31 13:17:08 +02:00
Stephan Bergmann
0bd502af47 Clean up remaining C-style casts among void pointers
Change-Id: I1b49c020d597b569e330482f4dbf20c15ccdae3f
2015-03-29 09:17:47 +02:00
Norbert Thiebaud
3c6fd5a59b Revert "tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo"
This reverts commit 1efe5fe380.
which broke windows.
2015-03-28 20:38:22 -05:00
Stephan Bergmann
2828d92eee Clean up C-style casts from pointers to void
Change-Id: I2ec58d0bfe13fae4fc2141f9b017b5a72e0ba2c2
2015-03-28 19:09:27 +01:00
Michael Stahl
1efe5fe380 tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo
When a SwTxtFormatInfo is created to format a paragraph, pre-compute the
result of vcl::ScriptRun::next() and cache it for future calls to
OutputDevice::GetTextBreak() and GetTextWidth().

This requires adapting a bunch of methods to pass the additional
parameter, and some classes to backup and restore the cache when they
replace the text of the SwTxtFormatInfo.

There is some code in vcl OutputDevice::ImplPrepareLayoutArgs()
to modify the passed string and replace digits depending on
"meTextLanguage" member; try to set it to the correct value when
creating the layout cache (unfortunately it's not possible if the user
sets the CTL Numerals config to the non-default "Context" value).

Another issue is the check in OutputDevice::ImplLayout() if there is
a mpConversion member on the font; apparently this is used to translate
between different Symbol fonts, so not very important; just ignore the
cache in this case.

This reduces vcl::ScriptRun::next() from 11 to 0.36 billion callgrind
cycles when built with GCC 4.9.2 -m32 -Os (which is still 16% of the
formatting).

Change-Id: I61fb8530333f2e7a9199f767c00cf2181ba49951
Reviewed-on: https://gerrit.libreoffice.org/14732
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-28 15:34:34 +00:00
Stephan Bergmann
6f3c52bb37 const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Icb14a036ea9d7636359b6bc5e0af17568c0d54cb
2015-03-26 15:33:38 +01:00
Bjoern Michaelsen
abb863a332 rename IsLastDepend HasOnlyOneListener
Change-Id: Ibb2a3ee596402661f2c593754061deb8c54a2f76
2015-03-25 10:25:08 +01:00
Bjoern Michaelsen
b8d5647180 rename GetDepends->HasWriterListener and make it a bool
Change-Id: Idc090c9e105f24ef91ef123db03db6d6e67ed1d4
2015-03-24 15:59:42 +01:00
Gulsah Kose
2db08b9ed6 tdf#89756 Switched postfix to prefix operator++/--
Replaced postfix to prefix operator++/-- to improving performance

Change-Id: Iaee7b22dbe21441b82612ae3a3e336cf56eb280f
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/14903
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-03-20 09:50:33 +00:00
Bjoern Michaelsen
d26725ad0f move SwIterator into calbck.hxx
Change-Id: Icdcd46d392bbf1dbe45448328c310d9a327ba60d
2015-03-19 23:41:06 +01:00
Caolán McNamara
3f6589a649 coverity#1288894 Dereference after null check, golden
regression from

commit 553a058ec8
Date:   Sat Mar 14 20:43:43 2015 +0100

    core: dont use 'shortcut' that is longer than the original

    Change-Id: I0154e484a4f4d6ce6672ddf35d1869157a61f71e

Change-Id: I4159a5caf492900bcfb863bc0bc5cf59a47a311c
2015-03-19 21:29:43 +00:00
Noel Grandin
6970a4dc77 convert DocumentSettingId to an enum class
Change-Id: Ia4f135c64e6b6b5bd7a522e4a1e9ca63738ff3ef
2015-03-18 14:23:49 +02:00
Bjoern Michaelsen
1fb1016eca Pipe legacy Modify calls through SwClientModify
Change-Id: Ic55abdee0486021d8361271fabec9fcaa06c3502
2015-03-16 20:37:23 +01:00
Bjoern Michaelsen
553a058ec8 core: dont use 'shortcut' that is longer than the original
Change-Id: I0154e484a4f4d6ce6672ddf35d1869157a61f71e
2015-03-16 15:17:59 +01:00
Noel Grandin
89245da9f4 fix windows build
after my commit 5eea85ec4f
"convert SwMoveFlags and SwInsertFlags from enum to enum class"

Change-Id: If5af977fdd77b82de447b71e166d81fca5840395
2015-03-11 13:40:46 +02:00