summaryrefslogtreecommitdiff
path: root/vcl/source/outdev/text.cxx
AgeCommit message (Collapse)AuthorFilesLines
2015-10-07afl-eventtesting: creating OUString from super long sal_Unicode* is slowCaolán McNamara1-1/+1
the mpStr and mnLength arguments are always created from an OUString and the OUString aRun(rArgs.mpStr); creates a duplicate of the original string. Its way faster to pass the original OUString around instead. Change-Id: I3de0cc31654eb215362548b6aee435f9c0c3c9db Reviewed-on: https://gerrit.libreoffice.org/19221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-10-01remove old standalone Sun bug numbersNoel Grandin1-1/+0
Sun bug numbers without any accompanying text are completely useless. Fixed with git grep -lP '//\s*#\d+#\s*$' | xargs perl -i -ne'/\/\/\s*#\d+#\s*$/d or print' And then hand-checking the result to restore places where it deleted code. And then some more grepping and hand-editing to kill the others. Change-Id: Ia96ce4466db8bb8da363ebf41f0ae7f45f28bf29 Reviewed-on: https://gerrit.libreoffice.org/19023 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-29vcl: replace alloca() with std::unique_ptrMichael Stahl1-13/+15
Change-Id: If0f44ac761afdf50a8e6f5c77023ae5d74fdcad9
2015-08-17Put Polygon from tools under tools:: namespaceNorbert Thiebaud1-5/+5
Polygon is one of these names that Clash with some system objects A similar work has been done earlier with PolyPolygon. Change-Id: Icf2217cb2906292b7275760f1a16be0e150312f5 Reviewed-on: https://gerrit.libreoffice.org/17789 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2015-07-09tdf#92630 Enable auto-accelerator behaviour for gtkSimon Long1-2/+7
Change-Id: I671177dd1f9e535c28a29bcbd6b74f1c789371ea Reviewed-on: https://gerrit.libreoffice.org/16883 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-04Fix typosAndrea Gelmini1-1/+1
Change-Id: Id9296115f30858e7fd470a199e59343a96d7deec Reviewed-on: https://gerrit.libreoffice.org/16712 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2015-06-30remove some unnecessary typedefs to pointerNoel Grandin1-3/+3
that were really not helping make the code any clearer. Found with a search git grep -P 'typedef\s+\w+\s*\*\s*\w+\;' and manual inspection Change-Id: I6a5c031e9e060ad3623a7586ec8a8cc4fe6252e9
2015-06-18Assertions should tell the line number where the problem isTor Lillqvist1-5/+6
Let's not hide the assert() in a function whose sole purpose is to call assert(). Change-Id: I7a8a04aad560b0f22398daabf12d00bbe58e89f1
2015-06-08loplugin:cstylecast: deal with remaining pointer castsStephan Bergmann1-3/+3
Change-Id: I07bf1403e6b992807541a499b786d47f835b2f81
2015-06-01masses of coverity FORWARD_NULL warnings from copied assertCaolán McNamara1-5/+5
Change-Id: I8f698bbcf4d53a4477cc0ee0c3f2c7f08e521f8a
2015-05-28new clang plugin: loopvartoosmallNoel Grandin1-1/+1
Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
2015-05-24rendercontext: Add asserts to easily catch the direct rendering cases.Jan Holesovsky1-1/+8
Change-Id: I5e05b08e30930740be0fdbb18169bf350e2eab9f
2015-05-22convert constants in include/vcl/settings.hxx to scoped enumsNoel Grandin1-3/+3
Change-Id: I2a110c017f13eca6ddbd70ef3ed195d24adef0a3 Reviewed-on: https://gerrit.libreoffice.org/15828 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-05-20convert DRAWMODE constants to scoped enumNoel Grandin1-17/+17
Change-Id: I36cbe8057d09226f8b302963bdd94dc5600b686f
2015-05-20convert TEXT_DRAW constants to scoped enumNoel Grandin1-56/+56
Change-Id: Ic0f7f8fa236bb478b3598ae3fd3c1b30ebbf1a01
2015-05-20convert SAL_LAYOUT flags to scoped enumNoel Grandin1-18/+18
Change-Id: I0aeea1f32136e43e90a1afb0ea84dbaff2b77587
2015-05-15convert META_*_ACTION constants to scoped enumNoel Grandin1-1/+1
Change-Id: I8ecfbfecd765a35fafcbcc5452b0d04a89be2459
2015-05-14convert KERNING_ constants to scoped enumNoel Grandin1-1/+1
Change-Id: I58031485aaa9ebdeb986a3ee0376f36a9f667947
2015-05-11loplugin:cstylecast: nop between pointer types of exactly same spellingStephan Bergmann1-2/+2
Change-Id: I0f844c7265b52d668bc6a2368321950a1a00cce5
2015-05-07convert BMP_VECTORIZE constants to scoped enumNoel Grandin1-1/+1
Change-Id: Ifa6614f6a17356481a335a686e9ea0f9b983c5c5 Reviewed-on: https://gerrit.libreoffice.org/15647 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-04-30Get rid of the initial :: for the vcl namespaceTor Lillqvist1-5/+5
We used it all over the place without leading :: already anyway, even in many files in include. So let's be consistent. In the majority of cases, prefer the easier-on-the-eyes choice, not the "safe" one. In those files in include where *all* existing uses of ::vcl:: indeed used the :: prefix, there let's keep it for consistency. Change-Id: If99cb41d3bf290d38c601d91125c3c8d935e61d0
2015-04-28Merge remote-tracking branch 'origin/feature/vclptr'Michael Meeks1-29/+29
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-20vcl: convert new to ::CreateMichael Meeks1-1/+1
Change-Id: Ifd52953086ea923fa1770892d13f32c2263aec54
2015-04-16overloading is hard to resolve for poor old c++Michael Stahl1-1/+1
Change-Id: I76ae48783942a558c674c5dcb2869540a819bf49
2015-04-16tdf#86793: vcl: speed up OutputDevice::GetEllipsisString()Michael Stahl1-1/+2
The ridiculous algrorithm used for TEXT_DRAW_CENTERELLIPSIS will go faster if we cut out most of the text at the beginning instead of one at a time. (regression from 912ecaf565e68d2ca3fb9584712313e712749f75) Change-Id: I9310dda1847222215bafe372e3efef9d365e1ad9
2015-04-10automated VclPtrInstance conversion.Michael Meeks1-2/+2
Change-Id: I9a1d47202e2794461f6ec44f3e72ee1dd2fde09d
2015-04-10remove un-necessary type punning.Michael Meeks1-4/+4
Change-Id: I4f05929daa8b78b309d8a0498a2bb3246af9e18a
2015-04-10start wrapping OutputDevice in VclPtrNoel Grandin1-24/+24
Change-Id: If3ecbb0599b50d50ce6b3997ca7892200c332ffe
2015-04-02loplugin:staticmethodsNoel Grandin1-1/+1
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
2015-03-31tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfoMichael Stahl1-12/+41
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-29loplugin:cstylecastStephan Bergmann1-2/+2
Change-Id: I999ec56219a7d9a9dc8c1e9310cc74dccd0ac099
2015-03-28Revert "tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfo"Norbert Thiebaud1-41/+12
This reverts commit 1efe5fe38031f7bc23150c35e4c68940621a1d5b. which broke windows.
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann1-4/+4
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
2015-03-28tdf#89666: vcl: speed up HbLayoutEngine with cache in SwTxtFormatInfoMichael Stahl1-12/+41
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-26const_cast: convert some C-style casts and remove some redundant onesStephan Bergmann1-1/+1
Change-Id: I17c57a85bcda98ef36ddefd6562d4681d0c7d5fc
2015-03-18vcl/text: fix duplicate text in fontwork tdf#81876Pierre-Eric Pelloux-Prayer1-0/+3
Regression introduced by commit 2ba05b4800d6cc322276a6911792363f8eb32051 because space character will take the error code path. The error propagates up to GetTextOutlines which then uses the fallback method. In this case, we now reset any work done before, to avoid having duplicate outlines. Change-Id: Ie15524ac462d4b4bb3c482e49c4fe96a2f2d2c71 Reviewed-on: https://gerrit.libreoffice.org/14850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-17bridges, vcl: turns out there is sal/alloca.h; replace #ifdeferyMichael Stahl1-3/+1
Change-Id: I2eda8dab51e66af7856b55f2d5f297620e07ccdb
2014-11-12alloca needs special include on SOLARISRichard PALO1-0/+4
Change-Id: I72415dbaf1350913938950eb1c0487a78cd67935 Signed-off-by: Michael Stahl <mstahl@redhat.com>
2014-11-03coverity#1209395 Dereference after null checkCaolán McNamara1-4/+4
since commit 808d273db098e2269e53813595a6bfc7b160e28e Date: Fri Apr 25 11:56:54 2014 +1000 Remove ImpInitOutDevData and ImplDeInitOutDevData in OutputDevice All these do is some very, very basic initialization. There is no need to lazy load the structure, it should be initialized when OutputDevice is created in the constructor and deinitialized in the destructor. mpOutDevData is never NULL Change-Id: Ie08f7520e8c09b57e056c086bba3089abe2486fa
2014-11-01tools & vcl: move OutputDevice::ImplRotatePos() to Point::RotateAbout()Chris Sherlock1-2/+4
OutputDevice has a private function that rotates a point around another point. However, there is no real reason why OutputDevice should be responsible for this - it's really the responsibility of the Point class in the tools module. Therefore, I've moved this functionality out of OutputDevice and into Point, but I've renamed it from the rather confusing name "ImplRotatePos" to "RotateAround", which is what it actually does. Change-Id: If12fb40a7b476653224d4edfc01887bc91a80c7d Reviewed-on: https://gerrit.libreoffice.org/12171 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2014-10-13create a macro library for implementing bit-flags typesNoel Grandin1-10/+10
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, changed from a macro- to a template-based solution. (Unfortunately MSVC 2012 does not support explicit conversion operators. Worked around that with explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a baseline that requires unconditional support for them.) Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
2014-10-09Resolves: fdo#84809 crash when button is too short for textCaolán McNamara1-1/+1
regression from 4c539fac018dfd44cd8db52161a8cb930c627da7 commit 4c539fac018dfd44cd8db52161a8cb930c627da7 Date: Tue Dec 17 05:18:35 2013 -0600 vcl get rid of xub_StrLen and STRING_LEN in outdev3 before this there was a dubious cast which hid the problem Change-Id: I7c01c0f0ac211196a62acaf02297f29ae829403d
2014-10-07coverity#1000506 Unchecked return valueCaolán McNamara1-1/+2
Change-Id: I71e824e7f0e279582f12d5cb9443a4177551a705
2014-09-30fdo#82577: Handle PolyPolygonNoel Grandin1-3/+3
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows PolyPolygon typedef. Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-30fdo#82577: Handle RegionNoel Grandin1-1/+1
Put the VCL Region class in the vcl namespace. Avoids clash with the X11 Region typedef. Change-Id: I6e008111df7cf37121fbc3eaabd44a8306338291
2014-09-18fdo#82577: Handle FontNoel Grandin1-3/+3
Put the VCL Font class in the vcl namespace. Avoids clash with the X11 Font typedef. Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-12Revert "vcl: use DeviceCoordinate for GetCaretPositions in sallayout"Norbert Thiebaud1-97/+20
This reverts commit 1b42acdaeae134f94580d6e1eba89da16741d596.
2014-09-12vcl: use DeviceCoordinate for GetCaretPositions in sallayoutNorbert Thiebaud1-20/+97
Change-Id: I5a959e1c3806da713e106c1b0fc8690a6578987b
2014-08-20vcl: use enum for complex text layout constantsNoel Grandin1-6/+6
Since these constants are bitfield flags, we define some methods to make working with them reasonably type safe. Move the definitions to outdevstate.hxx, since we need the values there, and that appears to be the "root most" header file. Also dump TEXT_LAYOUT_BIDI_LTR constant, since it means the same thing as TEXT_LAYOUT_DEFAULT (ie. 0), and leaving it in causes people to write weird code thinking that it's a real flag. Change-Id: Iddab86cd6c78181ceb8caa48e77e1f5a8e526343 Reviewed-on: https://gerrit.libreoffice.org/10676 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-08-14Revert "Resolves: fdo#82550 MacOSX GetTextBreak always return -1"Norbert Thiebaud1-6/+6
This reverts commit 4c1e2c446865b355f50720b8b96ec704822006dc. it was just hiding the underlying bug.