Commit graph

1050 commits

Author SHA1 Message Date
Mailson Menezes
83282971d8 Render current viewport only 2012-05-29 14:06:02 -03:00
Fabio D'Urso
e3f1c388de Ask "Save annotation changes?" if there are unsaved annotations that cannot be saved locally
This patch turns Okular into a ReadWritePart. Annotation editing is always
disabled if we're loaded as ReadOnlyPart, no matter the document type.

REVIEW: 105020
2012-05-23 23:43:44 +02:00
Fabio D'Urso
04935266d2 Fix wrong text 2012-05-23 00:52:20 +02:00
Fabio D'Urso
b3782d82a1 Fallback behavior for documents whose generator provides native annotation editing support without saveAs support
The only affected generator is poppler. Note that:
Document has /Encrypt <=iff=> SaveInterface supportsOption(SaveChanges) is false

This patch enforces the following behavior (and warns the user the first time
he edits an annotation).

- If the document has /Encrypt, warn that "Save as" is not available, but it's
possible to export as okular archive. New annotations will be automatically
saved to XML as usual.
Note that the previous patch already made all existing annotations uneditable,
because there's no way to save them.

- If the document has no /Encrypt and there are existing external annotations,
warn that changes won't be saved automatically. The user needs to "Save as" or
changes will be lost.

- If the document has no /Encrypt and there aren't existing external
annotations, don't show any warning. New annotations will be automatically saved
to XML as usual and to file if "Save as" is pressed.
2012-05-17 23:51:00 +02:00
Fabio D'Urso
b33d71ef81 Enable edit/removal of external annotations if the generator supports it 2012-05-17 23:50:55 +02:00
Fabio D'Urso
157638f2f9 Added Annotation::BeingMoved flag to avoid refreshing pixmaps while moving annotations 2012-05-17 23:50:39 +02:00
Fabio D'Urso
6c296b916b Use UUIDs intead of a (broken) counter to generate annotations' unique names
The previous counter-based approach didn't take into account existing names used
by external annotations and names used in other pages.
Instead of creating a document-global table of used names, I used random UUIDs
as a source of unique names.
2012-05-17 23:50:20 +02:00
Fabio D'Urso
68127e00ea Do not store flag Annotation::ExternallyDrawn when exporting to DOM
It's an implementation detail
2012-05-17 23:50:17 +02:00
Fabio D'Urso
249bea5985 Re-add restored annotations via Document so that AnnotationProxy gets notified
Previously, restored annotations followed a shorter path that bypassed AnnotationProxy
2012-05-17 23:50:14 +02:00
Fabio D'Urso
f6fa2a5614 Disable GUI operations on certain types of annotations
Modification and removal of *external* annotations are disabled by this
patch. Note that this change doesn't remove any functionality, because they
have never been implemented (AnnotationProxy is defined by the previous
patch).

The #if0'd blocks will be enabled by a future patch that provides fallback
behavior for generators that don't support saving changes.
2012-05-17 23:50:10 +02:00
Fabio D'Urso
ec9f068d77 Added AnnotationProxy to SaveInterface
Based on Pino Toscano's earlier work
2012-05-17 23:49:58 +02:00
Fabio D'Urso
07c57bb2ab Dead code removed (PagePrivate::modifyAnnotation)
The first if ("modified already") is always taken
2012-05-17 23:49:54 +02:00
Albert Astals Cid
df5b9cd4a2 Do not set mTextPageReady to true
mTextPageReady is only used for threaded generation and this is a sync one so resetting it to true make very bad things happen
An improvement of this area is needed since it makes no sense canGenerateTextPage returns mTextPageReady when generateTextPage doesn't use itB
BUGS: 297379
FIXED-IN: 4.8.3
(cherry picked from commit c29ce712cf)
2012-04-06 00:53:02 +02:00
Tobias Koenig
4639ded310 Implement autostart support for movie annotations
Evaluate MovieActions to implement autostart behavior for movie annotations.

REVIEW:104271
2012-04-03 14:18:10 +02:00
David Faure
dc2f2d36aa Fix compilation with strict iterators 2012-03-27 13:25:12 +02:00
Mailson Menezes
bd9087f20a Remember position on the page in bookmark
IOW accept more than one bookmark per page
BUGS: 157198
REVIEW: 104365
2012-03-26 20:01:01 +02:00
Albert Astals Cid
9d805df013 Double click selects words
BUGS: 187347
FIXED-IN: 4.9,0
2012-03-25 23:48:47 +02:00
Guillermo A. Amaral B
592c0c1611 Allow PDF Generator to handle embedded movies 2012-03-22 17:35:33 +00:00
Albert Astals Cid
d3d8025ef1 Merge remote-tracking branch 'origin/KDE/4.8'
Conflicts:
	VERSION
	core/version.h
2012-03-09 00:29:48 +01:00
Albert Astals Cid
bf47b97cc2 Do not return 0 in getFreeMemory for the first two seconds 2012-03-09 00:26:51 +01:00
Albert Astals Cid
4d8ba36488 Add greedy preloading option
Based on a patch by Sebastian Rose <s.rose@semkath.de>
REVIEW: 103129
BUGS: 184196
2012-03-09 00:12:20 +01:00
Albert Astals Cid
3e3a504d3c Allow the renaming of bookmark "parent" items (i.e. file names)
Patch heavily inspired on a patch by Constantin Serban-Radoi <costashsrc@gmail.com>
2012-03-08 23:26:44 +01:00
Albert Astals Cid
bd6219327f Update version for 4.8.1 2012-02-29 23:00:19 +01:00
Albert Astals Cid
d34bc7f263 Do not cache end() of a QList you are removing stuff from...
...makes it crash :D
BUGS: 294633
FIXED-IN: 4.8.1
2012-02-22 23:23:47 +01:00
Albert Astals Cid
04716f9fd1 Do not cache end() of a QList you are removing stuff from...
...makes it crash :D
BUGS: 294633
FIXED-IN: 4.8.1
2012-02-22 23:21:44 +01:00
Albert Astals Cid
80d7cf0b8a Merge branch 'textfind-enhancement'
Conflicts:
	core/textpage.cpp
2012-02-02 19:31:08 +01:00
Albert Astals Cid
12ab23e631 Add a note why we can't use rightRef 2012-02-02 19:27:57 +01:00
Albert Astals Cid
d6c1ead1b0 More small adaptations 2012-02-02 19:24:11 +01:00
Albert Astals Cid
e74894ce94 Put duplicate code in a function 2012-02-02 19:13:11 +01:00
Albert Astals Cid
7825e4c545 Fix stuff for a better merge 2012-02-02 19:07:13 +01:00
Mohammad Mahfuzur Rahman Mamun
92e3c16066 all len-1 are replaced with str.endsWith 2012-01-27 10:15:46 +06:00
Mohammad Mahfuzur Rahman Mamun
0c02a163ea Some minor changes and cleanup of Backward textfind 2012-01-23 15:08:07 +06:00
Albert Astals Cid
cc3d80dc33 bump devel version to 0.14.80 2012-01-18 18:05:35 +01:00
Albert Astals Cid
81c5c540df Update versions for KDE 4.8
(cherry picked from commit 51a77e6a51)
2012-01-18 18:04:31 +01:00
Albert Astals Cid
51a77e6a51 Update versions for KDE 4.8 2012-01-18 18:03:37 +01:00
Mohammad Mahfuzur Rahman Mamun
9afba5c75d Some textfind change 2012-01-18 14:50:34 +06:00
Mohammad Mahfuzur Rahman Mamun
1dd139736f both forward and backward find implemented and tested a bit 2012-01-12 19:34:11 +06:00
Mohammad Mahfuzur Rahman Mamun
f6a3ccf8b5 some printinfo and unnecessary comments has been removed 2012-01-12 13:51:47 +06:00
Mohammad Mahfuzur Rahman Mamun
7062308214 textfind with hyphenation working - simple test with pdf and djvu done 2012-01-12 12:57:48 +06:00
Albert Astals Cid
83a052b3ac Revert 604187b7a3 and 258cd6562a
I did not have time to finish the poppler work and even if this will probably be good for using the poppler work, this adds new API and I don't want to commit to this since having a proper look at making it work
Sorry i failed to fulfill my promise
2011-12-11 22:20:45 +01:00
Albert Astals Cid
428d2412bd Remove the need for the hash so we can map back from words to characters
This is needed because sometimes the hash had collissions and make it impossible to know which character we had to put back
Now we just keep the word and the characters together in the same class and it is much easier to correlate them
Also the code gets much more simplified and less new/delete are needed

This fixes the crash in 287138

I am still concerted that we use the page width and height in TextPagePrivate::correctTextOrder, but that should not cause crashes, at most some misplacements of very small text
2011-12-03 13:50:37 +01:00
Albert Astals Cid
972b514c21 Rework makeAndSortLines to return a list of qpairs instead of two lists 2011-12-01 00:09:00 +00:00
Albert Astals Cid
ad79f60045 entRect is const 2011-12-01 00:09:00 +00:00
Albert Astals Cid
2776b11276 Move the invocation of makeAndSortLines inside calculateStatisticalInformation 2011-12-01 00:09:00 +00:00
Albert Astals Cid
476e21e440 declare j and k in the for loop definition 2011-12-01 00:09:00 +00:00
Albert Astals Cid
b055d659b0 Simplify the code
TextPagePrivate::correctTextOrder was running makeAndSortLines + calculateStatisticalInformation to calculate the tcx, tcy
to pass it to XYCutForBoundingBoxes and then in XYCutForBoundingBoxes we were doing the same but just for when countLoop was not 0, thus
if we remove the first code and remove the check for countLoop being not 0 we end up with the same behaviour
2011-12-01 00:09:00 +00:00
Albert Astals Cid
d49894b9d2 the list does not change -> const 2011-12-01 00:09:00 +00:00
Albert Astals Cid
d704dd1ecd const + spacing fixes 2011-12-01 00:09:00 +00:00
Albert Astals Cid
8d7c2b2ce1 Make the function const to signal it does not change anything in the object 2011-12-01 00:09:00 +00:00
Albert Astals Cid
e8c7e8aa13 Do what the comment says 2011-12-01 00:09:00 +00:00