Age | Commit message (Collapse) | Author |
|
The method returns the number of selected objects,
not just a bool indicating whether any (or a particular)
object is selected, other than the
SwFEShell::IsObjSelected variant that takes a
`const SdrObject&` param.
Rename the method to make that clearer.
Change-Id: I30afec5322d2e6f1d31e5bc0ca6c252faa1fb4d8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180223
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
|
|
Change-Id: I370d18643b0c83c60846a0b6f051440a043c647a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176486
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Use same pattern as 42e6e26255b21c1bfde893f5aaf23d4a37ecee91
and dffdc0b1995e2b24304ce0651ca886bbf9cf4f95
Change-Id: If36ecdcbb771bfcde9836203e84586045d039c8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169693
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Change-Id: I4f4284b55d481caa006743688e6d83cc3c713b5c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168601
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
- makes the go to page spin control visible only when Navigate By is
set to Page and hides Previous/Next navigation buttons during this time
- makes the go to page control track the page number in the document
view
- reduces the preferred width of the Navigate By control to help reduce
the width of sidebar Navigator
Change-Id: I8d876a919ac18e69cf62381310389c00671d8596
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163723
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
|
|
Driving forward the Item reworks I now take the
ItemPool in focus: It now does not hold any items
anymore and should be renamed to something like
ItemInfoProvider/ItemHelper, since it's main purpose
is to provide the Defaults for the Item functionality.
There is that SfxItemInfo, only a struct and bundling
SlotID and ItemFlags. There are also the DefaultItems,
just handled as ptrs in an array. It is/was always
error-prone to keep these in sync. Remember that it's
also necessary for the order to not only being sorted
but being increments of one with no gaps allowed in
the WhichIDs to which the Items are bound.
I now bundled that to a new class ItemInfo that joins
WhichID, SlotID, ItemFlags and the default Item. This
is a pure virtual base class, it comes in three
derivations:
(1) ItemInfoStatic:
This is supposed to be global static and hosts the
Item in a std::unique_ptr to ensure cleanup. It is
designed to be constructed once during runtime and
being shared globally. It allows the ItemPtr to be
nullptr to mark as non-static (if initial static is
not possible for some reason) but still offers the
needed data. Most cases (95%+) are of that case.
The contained Item is owned by that instance. The
flag isStaticDefault() is set at the Item.
(2) ItemInfoDynamic:
This is supposed to be used for cases where the Item
cannot be static: Mainly for SfxSetItem (that needs
a Pool itself in the contained SfxItemSet, so lifetime
is bound to that Pool), but other cases showed up in
the transition. These instances live while the Pool
lives and get destructed when the Pool goes down.
Also uses std::unique_ptr for the Item instance for
as much automated cleanup as possible, the contained
Item is owned by that instance, the instance by the
Pool. The flag isDynamicDefault() is set at the Item.
(3) ItemInfoUser:
This is used for UserDefaults that can be set for
every ItemInfo entry to 'overshadow' the default
from the 'outside'. It uses a regular Item and
the central access methods implCreateItemEntry/
implCleanupItemEntry to manage the Item instance,
thus works like a SfxPoolItemHolder. The Item
instance can be globally shared and re-used even
when the Pool goes down. Instances belong to the
Pool and are cleaned up when the Pool goes down.
This Item does not need any further flag to be
set.
The ItemInfos are organized using a class
called ItemInfoPackage:
This bundles groups of ItemInfoStatic to
functional instances. There are derivations/
implementations of this e.g. for Writer ItemPool
bundling all the needed defaults for Writer,
similar for draw/impress, Calc and other usages.
These ItemInfoPackage can be 'registered' at an
ItemPool using it's method registerItemInfoPackage.
This does all the needed stuff to setup that
group of ItemInfos at the Pool (It even sets
internal vars First/LastWhich, that info can just
be derived from the buildup ItemInfo Ptrs).
The ItemInfoPackage has methods 'size()' and
'getItemInfo(index) to allow looping over it
and deliver the infos the Pool needs. The
(forced, pure virtual) overloads of getItemInfo
in the specific implementations check for the
ItemPtr being nullptr and create a exclusive
incarnation of ItemInfoDynamic for the Pool if
needed, returning that. The Pool owns the
ItemInfoDynamic incarnations and uses the
ItemInfoStatic directly. On shutdown it cleans
up the ItemInfoDynamic as needed.
The ItemInfoUser is used by the Pool when a
UserDefault is set/used: for SetUserDefaultItem,
GetUserDefaultItem, ResetUserDefaultItem. It
is not held in a 2nd list, but directly in the
list of ItemInfo'ptrs: To keep track of this
an unordered_map is used that helds the original
ItemInfo associated with the WhichID. That way
no two lookups (as before) are needed to get the
current Pool's default for any WhichID.
The derivations of ItemInfoPackage are
encapsulated and just allow access to an
ItemInfoPackage& with a single method as
return value. All use a static local instance
of a std::array<ItemInfoStatic, FIXED_SIZE>
which constructs all ItemInfoStatic and the
static Item instances - if already possible.
Sometimes it is necessary to overload the
constructor to set some static instances
for Items later than the lib init. These are
also just marked with nullptr as Item instance.
Some need to overload getItemInfo to complete
instances of ItemInfoStatic, if needed, or
create and deliver instances of ItemInfoDynamic.
The registerItemInfoPackage also offers a
optional lambda callback: there were two cases
where local data from the Pool was needed to
incarnate the item - just add that to the
call to registerItemInfoPackage if needed,
see examples in the adapted code.
For the re-use of Items this means that now
in SfxItemSet/SfxPoolItemHolder *true* static
Items can and will be used without RefCount
directly and globally. This is also the case
for dynamic Items, with the exception of
differing Pools for SfxSetItems which cannot
be done.
Future:
That design is already prepared to allow
solving that Pool-chaining problem: currently
there are master/sub-pools and all accesses
have to traverse that structure before even
doing anything.
For the future the idea is more to 'compose'
a Pool by registering ItemInfoPackages, e.g.
for Writer pool you may start with SfxItemPool,
register the writer-specific ItemInfoPackage,
then the one for DrawingLayer (if needed) and
the one for EditEngine.
It should also be possible to get to smaller
granularities of that packages. Ideas for
new ones will emerge. We might also think
about composing Pools which can e.g. run Writer
and Chart, so allowing to use Chart *without*
OLE stuff in Writer - just ideas...
More changes:
- Adapted all stuff, cleaned up old stuff/
definitions
- Removed FreezeIdRanges, that can be done
once per Pool on-demand (and cannot be
forgotten to be called)
- Merged XOutdevItemPool with SdrItemPool
and offered a ItemInfoPackage which joins
both needed sets of Items
- All the cleanup hassle with Pools and
defaults cleaned up
- Adapted all access methods of the pool
to use that new stuff. Pool chaining
currently stays, but I use a central
method 'getTargetPool' instead of
recursive calling to get the correct
Pool for the action
Change-Id: I2b8d3d4c3cc80b1d0d0b3c0f4bd90d7656b4bab7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163157
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
Change-Id: I30b2ac77b58e2ae1d1e997a0c830c513542b973d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158101
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I2134492fd681393da6f4fc29aec95117145e8e97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157735
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
|
|
This change is not about speed improvements but diverse
preparations to make changes/reading/understanding easier.
It does not change speed AFAIK.
Added a global static debug-only counter to allow getting
an overview over number of all allocated SfxPoolItem's
and the still alloated ones at office shutdown. The values
are used in Application::~Application to make a short info
statement. It allows to be able to quickly detect if an
error in future changes may lead to memory losses - these
would show in dramaitically higher numbers then (hopefully)
immediately.
Moved SfxVoidItem to own source/header.
Added container library interface support to SfxItemSet,
adapted already some methods to use it - not all possible,
I will commit & get status from gerrit 1st if all still works
and then continue.
Changed INVALID_POOL_ITEM from -1 to use a global unique
incarnation of an isolated derivation from SfxPoolItem. It
allows to avoid the (-1) pointer hack. Since still just
pointers are compared it's not worse. NOTE: That way, more
'special' SfxPoolItem's may be used for more States - a
candidate is e.g. SfxVoidItem(0) which represents ::DISABLED
state -- unfortunately not only, it is also used (mainly for
UI stuff) with 'real' WhichIDs - hard to sort out, will have
to stay that way for now AFAIK.
Changed INVALID_POOL_ITEM stuff to use a static extern
incarnated item in combination with a inline method
to return it, called GetGlobalStaticInvalidItemInstance().
Isolated create/cleanup of a SfxPoolItem entry in
SfxItemSet to further modularize/simplify that. It is
currently from constructor & destructor but already shows
that PoolDefaults are handled differently - probably an
error. Still, for now, do no change in behaviour (yet).
Got regular 'killed by the Kill-Wrapper' messages from
gerrit, seems to have to do with UITest_sw_findReplace.
That python/c++ scripting stuff is hard to debug, but
finally I identified the problem has to do with
the INVALID_POOL_ITEM change. It was in
SfxItemSet::InvalidateAllItems() where still a (-1)
was used -> chaos in detecting invalid items.
Change-Id: I595e1f25ab660c35c4f2d19c233d1dfadfe25214
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155675
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
The problem was that repeatedly pressing F2,
or any non-mouse movement between cells
was getting a "random" formula returned.
The only thing that worked was moving the mouse,
because on every pixel change, it re-loads
the RequestHelp tooltip that displays the formula,
thus loading it as the most current formula.
The example bug document easily crashes,
and everything about this is terribly imprecise,
so I'm not attempting to make any unit test here.
The code is modeled from GetContentAtPos,
which also does an unconditional const_cast.
Change-Id: Iecaf2e9a56bccef9a1e05bc0667caad6c3aeb109
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151550
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
|
|
Standardize on OUString, which is the main internal string class.
Convert from/to OUString only when communicating with respective
external APIs.
Removes about 200 conversions from the code.
Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Instead of (ab)using SdrObjKind::NONE for the temporary, empty
SdrObject instance in writer when creating a new frame, use a new
SdrObjKind::NewFrame kind for the object and use a empty SdrObject
instance EmptyObject - minimal implementation of SdrObject).
Change-Id: I0277a8f0cf7bfd428e106258ae8710b77e62c41b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149924
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
See https://crashreport.libreoffice.org/stats/signature/SwView::GetDocShell()
Change-Id: I90ebbff5082f1f9cae7fa3b940cbb9796d6c6dd3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149223
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
|
|
Change-Id: I8d99e9108f6163eafb7576603826f8d02a0ff416
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147336
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
change it to take a reference
Change-Id: Ib9349f4c2660d297d93ee81256e7fa9873728ba3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147163
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
various null checks can be seen to be redundant and removed
Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
In SdrPaintView (and subclasses) the mpModel variable is always
the same as the input (reference) model, so there is no need for
that extra variable.
Change the strange and confusing var. name mrSdrModelFromSdrView
(the input reference to SdrModel) to just mrModel and use that in
GetModel(). Change the GetModel() to return a reference instead
of a pointer and reactor the code to accomodate the change.
This gets rid of many nullptr checks for the pointer that the
GetModel() returns and makes the code more simple is some cases.
Change-Id: I18351a417fd82f49262a83de036ec1420a65399c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146373
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
SfxObjectShell::Current() can return null, it's based on the equally
vile SfxViewFrame::Current()
Change-Id: Ia5c7783680e9d8e5d3075078f16a2c15cb6f7a47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144339
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
these ones looks potentially worth backporting
Change-Id: I294fa029b53fa9d43cb738f07278301e2a06c210
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
|
|
use more ImplInheritanceHelper to reduce boilerplate
Change-Id: I0bf96b2e3d897d19d4883c2958c72fbfe3b61080
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144164
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
To make it more obvious that this flag describes the relatively obscure
feature where a direct format on one paragraph automatically makes it
into its style and all other paragraphs with the same style are updated
accordingly, kind of preventing real direct formatting.
Change-Id: Ia97929cd65f1aa0ff7f11425ec6d00f234053921
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144051
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: Ic7dd2cb433add02ecc72eee0c85dd7f0efe1d47b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143771
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Change-Id: I42bef355eeef15e3733a5ee57b0569887cfa5e84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142183
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
...as is used by e.g. Writer's "View - Toolbars - Form Controls", then
Ctrl+click the "Text Box" icon:
After ebd7cc1848ba2010128d09c5db524af2c6f5aa66 "tdf#150845: sw_uiwriter3: Add
unittest", my 2560x1600 screen Windows laptop kept failing
CppunitTest_sw_uiwriter3 with
> sw/qa/extras/uiwriter/uiwriter3.cxx:962:testTdf150845::TestBody
> equality assertion failed
> - Expected: 1
> - Actual : 0
As it turned out, SwDrawBase::GetDefaultCenterPos happened to pick a position
that didn't fall on the single page horizontally centered in the Writer window,
but on the background surrounding it, so in SwFEShell::BeginCreate
(sw/source/core/frmedt/feshview.cxx)
> if ( GetPageNumber( rPos ) )
failed and no control was created (and so the number of shapes expected by the
test wasn't matched).
The logic to adjust aCenter based on aDocSz is there ever since
39ed6bd497f2fed29c84023aa7d1739b303fd043 "#104503# put inserted control at a
central position", but that's hard to understand for me because it's hard to
understand for me how SwRootFrame::CheckViewLayout in
sw/source/core/layout/pagechg.cxx computes aNewSize (which is what ends up here
as aDocSz): At least when the Writer window width is larger than necessary to
show the full page, aDocSz.Width() apparently doesn't only measure the page's
width, but also (part of?) the width of the surrounding background on its left,
so the aCenter.setX(...) adjustment could have come up with an X coordinate that
wasn't actually centered on the page as apparently expected by the original
code.
Experimentally, I learned that for the three Writer view modes:
* "Single-page view" corresponds to GetViewLayoutColumns() == 1 and displays the
page horizontally centered in the window.
* "Multiple-page view" corresponds to GetViewLayoutColumns() == 0 and displays
the pages starting flush left in the window.
* "Book view" corresponds to GetViewLayoutColumns() == 2 and displays the two
pages horizontally centered in the window.
And at least when the window width is substantially larger than necessary to
show the one full page of a one-page document (as when showing a default
full-size Writer window on my 2560x1600 screen Windows laptop), the behavior of
inserting a default-positioned Ctrl+click "Text Box" icon is:
* For "Single-page view" it now actually inserts the control, horizontally
centered on the page (instead of not inserting it at all, or inserting it not
horizontally centered).
* For "Multiple-page view" it keeps inserting the control horizontally centered
on the page, as before.
* For "Book view" it keeps not inserting the control, as before, as apparently
before and after it happens to compute positions (albeit different ones) that
fall on the background.
Change-Id: Icf7dd30d4ce81e9d47a3c362f455f721f9e3dd30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140334
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I9a3b33595e34a264baeede33672a0c090ae85157
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138134
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
Also fixes: tdf#134007 tdf#138835 tdf#139514
When a character is deleted via the keyboard by Backspace or Delete key,
an artificial selection is created in SwWrtShell::DelLeft()/DelRight().
Ideally this should not delete flys that may be anchored to the
paragraphs, but unfortunately this may happen if there are only 2 empty
paragraphs in the section, because then the artificial selection cannot
be distinguished by the SwDoc implementation from a selection from
Ctrl+A (Select All), which *should* delete the flys.
So introduce a new flag that needs to be passed down multiple layers so
that SwUndoDelete can use it to determine if flys should be deleted, and
translating it to a flag that had been introduced to preserve flys in
ReplaceRange() previously.
There are a couple more callers that look like they want to "replace"
some text, so guess a bit at where to set this new flag.
(note: of course fly anchored *as char* must be deleted via keys.)
(regression from commit e75dd1fc992f168f24d66595265a978071cdd277)
Change-Id: Ib4467476b12a12aefbbcb74ab9802f9318cf9aa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135476
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
|
|
Patch in case consistency is required for suggested Draw/Impress change here : https://gerrit.libreoffice.org/c/core/+/134499
Change-Id: If4f51109633338620cfe836695214df20c3ec577
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134682
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
|
|
Change-Id: Iaf3a0a42e94994eab25f5e9ef8c111362e86fb02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
See tdf#42949 for motivation
Change-Id: I8a8df68946297fad517b753d73e4373203a45ed6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132150
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
|
|
Change-Id: I4f74999b88d425f6d36b03bc5ee88f996f6844c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131874
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
|
|
... SwJumpToSpecificBox_Impl and SwZoomBox_Impl
See tdf#94879 for motivation.
Change-Id: I5daf3f0a2c0c712a554aa32a6a219acb07d64a32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128201
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is
in the right range.
Which exposes some dodgy code in DrawViewShell::GetMenuStateSel
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) ||
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) ||
which has been there ever since
commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b
Date: Mon Sep 18 16:07:07 2000 +0000
initial import
just remove that.
In SwFEShell::ImpEndCreate() move some logic around to avoid
using an out-of-range SdrObjKind value
Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
... SwXAutoTextEntry and SwXAutoTextGroup
See tdf#94879 for motivation.
Change-Id: Ie09cd100e1ecc29a7e5e4b68d566785ba63e5da3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127881
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
to replace the cppu:: equivalent with a lightweight version
that uses std::mutex instead of osl::Mutex
Change-Id: I1b7873a0c2d9cda21f529e43a4ac2fa7574c91a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127335
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
and remove some unused defines
Change-Id: Ie560fccb674568ba88175d2e68ca83b92cfcf312
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126544
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
... SwInsertAuthMarkWrapper
See tdf#94879 for motivation.
Change-Id: I4547c51afb5a63781105d2a5ebe0b6ed6245428b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124833
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
Change-Id: I69e188d7599b7fc439f613cec0a0967ccb748b7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123313
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
MM50 constant is the number of twips for 5mm. This is (ab)used as
a "shortcut" to set or compare various variables through the code
and also to set a multiplied value (like 1cm, 2cm, 4cm) or divided
value (2.5mm, 1.25mm). The problem with this is that converting the
5mm to twip doesn't round up exactly and multiplied and divided
values increase the error even more.
Instead of basing it from MM50 constant, it is just better to use
our o3tl::convert (or the added variant o3tl::toTwip), which can
actually calculate the conversion at compile time, so there is no
added complexity at runtime and we get a more readable code with
more exact result.
i.e.
o3tl::toTwip(4, o3tl::Length::cm)
instead of the more cryptic
MM50 * 8
In addition also sanitize and comment the values of the constants
in sw/inc/swtypes.hxx.
Change-Id: I85c306c36207d47ac3dc207094b68d0fb1ca5b70
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119397
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
because this is often on a hot path, and we can avoid the splitting and
joining of strings like this.
Change-Id: Ia36047209368ca53431178c2e8723a18cfe8260a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119220
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
MM50 is a constant representing 0.5cm in twips. Use o3tl::convert
for to init the constant instead. It matches the constant which I
checked with a static_assert.
Change-Id: Ib6c37a44ef5b22258e913fd3809a37ab0d18671b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119396
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Before commit 653b53287ca09a9ffe3f5ce0242919e719c1086c, editengine
objects had a pair IsVertical/SetVertical, which queried and set
a boolean flag (and SetVertical also had a second argument to set
another flag).
The mentioned commit had introduced an inconsistency, changing
SetVertical to only set a single flag, but at the same time making
IsVertical to return a synthesized result from two values: vertical
and rotation. Additionally, GetDirectVertical was introduced to
complement SetVertical.
In many places, the use of synthetic IsVertical looks suspicious,
especially where it is used in combinations with SetVertical. But
here I don't change existing logic, and only rename the methods,
so that in case someone sees an actual problem, it would be easier
to spot the method mismatch.
The end result is that now we have a proper getter/setter pair
GetVertical/SetVertical, and also IsEffectivelyVertical, named to
reflect that it calculates its return value.
Change-Id: I38e2b7c5bd7af0787dd7a1c48e1385138dac80b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119315
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
... in WhichRangesContainer and SfxItemSet ctors. Now it's not needed
to explicitly use 'value' in WhichRangesContainer's ctor, or create an
instance for use in SfxItemSet ctor (svl::Items is already defined as
a template value of corresponding type).
Instead of
WhichRangesContainer Foo(svl::Items<1, 2>::value);
SfxItemSet Bar(rItemPool, svl::Items<1, 2>{});
now use:
WhichRangesContainer Foo(svl::Items<1, 2>);
SfxItemSet Bar(rItemPool, svl::Items<1, 2>);
Change-Id: I4681d952b6442732025e5a26768098878907a238
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119157
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
|
|
Rename ::StateChanged methods using SfxItemState to allow
better analysis of SfxItemState/SfxPoolItem usage(s),
discussion see tdf#130428 comment 30
Change-Id: I736be0160ad7a9b7882c1c8a4cc05d9396ee3305
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117366
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
|
|
Change-Id: Ic20c9dc7b8109cb095a883f2dfcec3e4f10b2428
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117352
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
|
|
Change-Id: I715aa9499598c483ccf907f829c9ba3540edf216
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116120
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|
|
o3tl::narrowing() is a better way to handle this, as that way the
integer conversion is still implicit, which allows detecting integer
truncation at runtime (with suitable compiler flags).
Change-Id: I499abda3be6943e8c111c56df390e72939586221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
|
|
This patch includes the current field type name in the tooltip for
Navigate By next and previous buttons for 'Field by type' navigation or
'[NONE]' if the current cursor position is not at a field.
Change-Id: I0894aeed0f20e2844b413ee399d65978f31fb758
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115451
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
|
|
Change-Id: I076f16d0536b534abf0ced4d76051eadb4c0e033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114949
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
|
|
Change-Id: I3cc464a3d5097b4e0438ea22ebf6daad5a2f2a86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112144
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
|
|
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
|