-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,14 @@ function expandDocument(doc as Object, oStatusBar as Object) | |
' go through pages in reverse order | ||
for i = numSlides-1 to 0 step -1 | ||
slide = doc.drawPages(i) | ||
if slide.IsPageNumberVisible then | ||
fixateSlideNumber(doc, slide, i+1, numSlides) | ||
end if | ||
' If the slide name is pageXXn it is an autogenerated name | ||
' It is impossible to name a slide "Slide XX", but "Slide: XX" works | ||
if Left(slide.Name, 4) = "page" then | ||
slide.Name = "Slide: " & CStr(i+1) | ||
end if | ||
oStatusBar.setValue(numSlides-i) | ||
if hasAnimation(slide) then | ||
n = countAnimationSteps(slide) | ||
|
@@ -157,7 +165,27 @@ function expandDocument(doc as Object, oStatusBar as Object) | |
|
||
' saving the expanded version | ||
doc.store() | ||
end function | ||
|
||
function fixateSlideNumber(doc as Object, slide as Object, slideNr as Integer, slideCount as Integer) | ||
master = slide.MasterPage | ||
shapeCount = master.getCount() | ||
for shapeNr = 0 to shapeCount-1 | ||
shape = master.getByIndex(shapeNr) | ||
shapeType = shape.getShapeType() | ||
if shapeType = "com.sun.star.presentation.SlideNumberShape" then | ||
copy = doc.createInstance("com.sun.star.drawing.TextShape") | ||
'Call Tools.WritedbgInfo(shape) | ||
slide.IsPageNumberVisible = False | ||
slide.add(copy) | ||
copy.setString(CStr(slideNr) & " / " & CStr(slideCount)) | ||
copy.Style = shape.Style | ||
copy.Text.Style = shape.Text.Style | ||
copy.Position = shape.Position | ||
copy.Size = shape.Size | ||
copy.TextVerticalAdjust = shape.TextVerticalAdjust | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zzjjzzgggg
Contributor
|
||
end if | ||
next | ||
end function | ||
|
||
function somethingWrong( slide as Object ) | ||
|
This
copy
object doesn't preserve the font size and alignment ofshape
.copy
is different from the font size ofshape
.shape
is right aligned, the text incopy
is still left aligned.I have been reading the libreoffice API document for quite a while, it seems that
TextShape
doesn't have a property controlling its alignment.