Issue 121443 - Insert picture (from file) focus jumps to end of document
Summary: Insert picture (from file) focus jumps to end of document
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: editing (show other issues)
Version: 3.4.1
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.1.1
Assignee: Oliver-Rainer Wittmann
QA Contact:
URL:
Keywords:
: 123393 124190 124550 (view as issue list)
Depends on:
Blocks: 121500
  Show dependency tree
 
Reported: 2012-12-06 11:29 UTC by James
Modified: 2017-05-20 10:35 UTC (History)
16 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.1.0
Developer Difficulty: ---
jsc: 4.1.1_release_blocker+


Attachments
Screen shot (145.92 KB, image/png)
2012-12-19 17:48 UTC, James
no flags Details
Example document (15.63 KB, application/vnd.oasis.opendocument.text)
2012-12-19 17:48 UTC, James
no flags Details
Test document with more that 100 pages (202.31 KB, application/vnd.oasis.opendocument.text)
2013-09-04 20:28 UTC, Ariel Constenla-Haile
no flags Details
Small space added after Image inserted between text (35.70 KB, image/jpeg)
2014-08-05 23:46 UTC, Rekha S
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description James 2012-12-06 11:29:54 UTC
Inserting a picture mid document causes the following:

1. Writer assumes I want to go to the bottom of the very last page of my document. I don't - I want to stay with the picture.

2. Writer assumes I want the picture in front of all of my text. I don't, I want the text to be wrapped top and bottom. Even when I change the wrapping to "none" which seems to mean top and bottom it is still in front of all the text. I have to drag it around a few times and resize it to get it to top and bottom wrap.
Comment 1 Oliver-Rainer Wittmann 2012-12-07 11:16:19 UTC
@James:
In general a picture inserted via Menu - Insert - Picture - From file is inserted at the position where the cursor is located. It is anchored at the paragraph the cursor is in with wrapping style "None".
By your description I assume that your Frame Style "Graphics" somehow had changed.
Can you attach a sample document in order to reproduce the described behavior?
The sample document would contain the definition of the Frame Style "Graphics". Thus, it would be possible to check my assumption.
Comment 2 stfhell 2012-12-18 21:51:55 UTC
Comment #0 is about 2 different issues:

re 1:
Inserting an image makes Writer jump its view to the end of the document. Which is a known issue (see Bug #50867, with a number of duplicates, recently Bug #121219). I have attached a sample doc at Bug #50867.

re 2:
If you drag an image to the document, Writer (AOO 3.4.1, AOO350m1 Build:9611 Rev. 1420743/2012-12-13) inserts it centered with anchor to paragraph and optimal page-wrap (according to dialog settings). You have to change it for every image, of course, to whatever you like. "No wrap" seems (for me) to do what James wants - text follows after the image. But there is a bug with the default placemant after d&d or Insert: If I change the wrap back to "optimal page-wrap" it looks different than immediately after the d&d (which actually looked like "wrap-through").
Comment 3 James 2012-12-19 17:48:26 UTC
Created attachment 80052 [details]
Screen shot
Comment 4 James 2012-12-19 17:48:44 UTC
Created attachment 80053 [details]
Example document
Comment 5 James 2012-12-19 17:54:54 UTC
@Oliver:
Sorry about the late reply, its been a busy few weeks.
The sample stfhell gives at Bug #50867 is a good example of my first point. The drag-and-drop solution suggested works well. 


I have attached a sample document for the second point; at the end of page two I have inserted some text I want a picture to be anchored to, one picture per line. Here are the steps I take:
1. Select the start of the sentence "I want a picture above this text 1"
2. Go to Menu - Insert - Picture - From file and select the picture
3. Picture inserted in the correct position :-)
4. Select the start of the sentence "I want a picture above this text 2"
5. Go to Menu - Insert - Picture - From file and select the picture
6. Picture inserted is over the top of the previous picture and in this example the text is over the top of other text too.

Additionally the problem only seems to occur on images that aren't the full width of the page, the images I am using are between 413 px wide x 635 px high and 749 px wide x 1141 px high.

@stfhell:

Thanks for the drag-and-drop tip!
Comment 6 stfhell 2012-12-20 12:41:49 UTC
(In reply to comment #5)
> 2. Go to Menu - Insert - Picture - From file and select the picture
> 3. Picture inserted in the correct position :-)

OO jumping to the end (or start of the document) when frames or images are edited does not happen in all documents. I have edited documents where everything works as it should (as in your sample doc), documents where Writer always jumps (like attachment #80046 [details]), and documents where it sometimes jumps. It's a mystery to me what exactly triggers this behaviour. But I don't think inserting an image via menu or d&d makes a difference.

> 4. Select the start of the sentence "I want a picture above this text 2"
> 5. Go to Menu - Insert - Picture - From file and select the picture
> 6. Picture inserted is over the top of the previous picture and in this
> example the text is over the top of other text too.
> 
> Additionally the problem only seems to occur on images that aren't the full
> width of the page, the images I am using are between 413 px wide x 635 px
> high and 749 px wide x 1141 px high.

If anchor, position and flow settings are correct, this should work. When I insert an image (small or big) in your sample doc, it does not overlay any text (AOO 3.4.1/Linux64). In your screenshot, a paragraph overlays a different paragraph, which shouldn't happen. Can you save the document and reload it with overlaid text still visible?

If you want a paragraph with an image on top of it to appear on the same page (with no page break between image and text), the only secure solution is to insert a frame that contains both image and text. Otherwise there can be page breaks after the image.
Comment 7 binguo 2012-12-21 10:08:39 UTC
Need further verification
Comment 8 Edwin Sharp 2013-01-16 19:46:21 UTC
(In reply to comment #5)
> @Oliver:
> Sorry about the late reply, its been a busy few weeks.
> The sample stfhell gives at Bug #50867 is a good example of my first point.
> The drag-and-drop solution suggested works well. 
> 
> 
> I have attached a sample document for the second point; at the end of page
> two I have inserted some text I want a picture to be anchored to, one
> picture per line. Here are the steps I take:
> 1. Select the start of the sentence "I want a picture above this text 1"
> 2. Go to Menu - Insert - Picture - From file and select the picture
> 3. Picture inserted in the correct position :-)
> 4. Select the start of the sentence "I want a picture above this text 2"
> 5. Go to Menu - Insert - Picture - From file and select the picture
> 6. Picture inserted is over the top of the previous picture and in this
> example the text is over the top of other text too.
> 
> Additionally the problem only seems to occur on images that aren't the full
> width of the page, the images I am using are between 413 px wide x 635 px
> high and 749 px wide x 1141 px high.
> 
> @stfhell:
> 
> Thanks for the drag-and-drop tip!

point 6 doesn't happen to me.
Comment 9 Edwin Sharp 2013-01-16 19:49:34 UTC
No jump to last page and no picture over picture.
Comment 10 Ariel Constenla-Haile 2013-09-04 20:28:55 UTC
Created attachment 81452 [details]
Test document with more that 100 pages

- Open the attached document
- Put the cursor at the beginning of the document
- Open the Gallery from the Sidebar
- Right-click on any graphic, and from the context menu select Insert - Link
- The document view jumps to the end of the document, though the graphic is selected
Comment 11 Ariel Constenla-Haile 2013-09-04 20:30:57 UTC
Reopening
It is reproducible with the document in attachment 81452 [details]
Comment 12 Ariel Constenla-Haile 2013-09-04 20:33:46 UTC
Other related/duplicated bugs:
Bug 50867
Bug 121219
Comment 13 Ariel Constenla-Haile 2013-09-30 18:06:35 UTC
*** Issue 123393 has been marked as a duplicate of this issue. ***
Comment 14 Rainer Bielefeld 2013-10-01 13:00:33 UTC
I often see that during my daily work and also with Sample document "2013-09-04 22:28 CEST, Ariel Constenla-Haile ":

1. Open Document from AOO Start Center
2. With Find Toolbar find String "Gregor selbst mußte handeln" (page 90 or so)
3. Click behind dot at end of that sentence.
4. Open Gallery -> Homepage
5. Click arbitrary picture (bludown) -> Drag and Drop it to caret position 
   behind paragraph
   First problem (irrelevant here):
                  as soon as mouse pointer reaches paper sheet area focus 
                  changes, for me to page 7. 
                  Because I was not able to find old caret position I moved 
                  Mouse Pointer behind dot of
                  "Beginn der abwärts führenden Treppe" and released mouse 
                  button
                  > Picture became inserted between paragraphs, anchored to 
                    paragraph.
   Second problem: As soon as I released mouse button, focus changed to
                   end of document (bottom right corner of last page becomes 
                   visible).

Additional info:
----------------
a) original test with  "AOO 4.0.1 RC3  – German UI / German locale  [Rev. 1524958 2013-09-20 11:40:29]" on  German WIN7 Home Premium (64bit)", “historic”  4.0  User Profile used for all  predecessor versions

b) Behaviour with other Versions:
b1) OOo 3.1.1: First problem does exist, second does not.
b2) AOO 3.4.1 as OOo 3.1.1, same OOo 1.1.1
c) First problem is irrelevant here, because not visible when insert picture from file or similar
d) Second problem (relevant here) reproducible in Step 5 you use
   'rightclick on gallery picture -> Add -> Copy'
e) Are we really sure concerning Version (in selector) 3.4.1 ? I can't 
   reproduce the problem with that version on WIN
g) I reduce Summary to reproducible part of the report, if someone can
   reproduce the other problems from originla report please submit separate
   new bugs
              
@Edwin:
Strange! What AOO Version? What OS?
Comment 15 Rainer Bielefeld 2013-10-01 13:14:33 UTC
h) Strange Variation with  server installation of  " AOO 4.0.0-Dev  – English UI / German locale [AOO400m1(Build:9700) - Rev. 1457992 - Rev.1457606]" on German WIN7 Home Premium (64bit)", own separate user profile: after My step 5 focus first jumps to end of document, after less than 1 second to begin of document. 

i) Problem is not limited to pictures, with document 2013-09-04 22:28 and
"AOO 4.0.1 RC3  – German UI / German locale  [Rev. 1524958 2013-09-20 11:40:29]" on  German WIN7 Home Premium (64bit)", “historic”  4.0  User Profile used for all  predecessor versions (others not tested I also see the problem after my step 5 for 'Insert -> Frame', but not for other objects like Chart, Forumla, ...
Comment 16 Rainer Bielefeld 2014-04-05 09:02:05 UTC
*** Issue 124550 has been marked as a duplicate of this issue. ***
Comment 17 Edwin Sharp 2014-04-22 16:51:18 UTC
Duplicate bug

*** This issue has been marked as a duplicate of issue 124721 ***
Comment 18 Rainer Bielefeld 2014-04-22 17:39:13 UTC
Here we have a useful sample document, 9 followers, 2 DUPS, a developer in CC ...

Issue 124721: no DUPs, no Developer in CC, a rather unhandy sample document 

In such a case, where all indications advise to make Issue 124721 a DUP of this one, it would be wise to follow a developer's advice Issue 124721 Comment 11
Comment 19 Edwin Sharp 2014-04-22 18:08:51 UTC
reopening
Comment 20 Edwin Sharp 2014-04-22 18:13:13 UTC
Original attachment - attachment 80053 [details] is irreproducible for me.
Attachment 81452 [details] shows a momentarily jump while attachment of issue 124721 shows a permanent jump.
-> issues may be related but not duplicate.
Comment 21 Rainer Bielefeld 2014-05-16 17:25:20 UTC
*** Issue 124190 has been marked as a duplicate of this issue. ***
Comment 22 Andrea Pescetti 2014-07-10 06:58:28 UTC
This is a confirmed bug, with duplicates, reports on users lists and sample document available. Unfortunately, there is no patch available yet. But it seems worth a look for release 4.1.1 if possible.
Comment 23 Armin Le Grand 2014-07-14 16:42:40 UTC
I experimented a litle bit with the trunk version. It starts to happen with 31 pages, does not happen with 30 pages. To reproduce:
- New writer
- DT + F3 (test text)
- copy all
- insert/field/page number
- cursor one back
- paste until 30 or 31 pages reached
- scroll half up, set cursor somewhere
- D&D pic from gallery (used homepage/bludown as described)

-> 30P -> focus stays at inserted graphic, can be moved with cursor

-> 31P -> inserted graphic selected, no focus on text at all, display jumps to last paragraph on last page

Thus depends on content of document, probably number of pages, also possible paragraphs or chars. This may hint to some overrun in some selection calculation. Also possible is a problem with the involved vertical scrollbar (wasn't there a problem in the mac version, too?)
Comment 24 Armin Le Grand 2014-07-14 16:50:05 UTC
Another guess: maybe that the max distance on page 31 from top page in twips comes close or goes over 65536 twips, that would be a candidate for numerical problems...
Comment 25 Oliver-Rainer Wittmann 2014-07-15 06:44:41 UTC
taking over to work on a solution
Comment 26 Oliver-Rainer Wittmann 2014-07-15 09:01:28 UTC
defect cause:
In text documents with more than 30 pages ridiculous 'layout algorithm optimization code' is triggered - the newly inserted text frame or graphic is not registered at the page its anchor is on, but at a page at the end of the document. This suppresses the formatting of the newly inserted text frame/graphic - its position. But the newly inserted text frame/graphic is selected and the selection is made visible. Due to the fact that the text frame/graphic is not formatted its position is not set. Thus, its area which is made visible is not the one at which the text frame/graphic has been inserted.

A solution is in progress. When the solution is available we should consider its integration into the planned 4.1.1 release.
Comment 27 SVN Robot 2014-07-15 12:15:38 UTC
"orw" committed SVN revision 1610671 into trunk:
121443: - register text frames and graphics on the correct page frame
Comment 28 Oliver-Rainer Wittmann 2014-07-15 12:23:19 UTC
fixed on trunk

+1 for its integration into planned 4.1.1 release as issue 50867, issue 121219 and issue 124721 are also fixed by the provided fix.
Comment 29 jsc 2014-07-15 14:44:41 UTC
grant showstopper flag, fix available
Comment 30 SVN Robot 2014-07-15 15:12:17 UTC
"orw" committed SVN revision 1610722 into branches/AOO410:
121443: - register text frames and graphics on the correct page frame
Comment 31 Oliver-Rainer Wittmann 2014-07-15 15:22:19 UTC
fixed on branch AOO410 for planned 4.1.1 release
Comment 32 fanyuzhen 2014-07-18 10:06:57 UTC
Current available build AOO 4.1.1 M2(AOO411m2(Build:9771)  -  Rev. 1608452
2014-07-07 15:29:02 (Mon, 07 Jul 2014)) doesn't include the fix, waiting for next build(M3)
Comment 33 Rekha S 2014-08-05 23:45:01 UTC
Verified this issue is fixed on Windows 8
AOO 4.1.1 m4 , build : 9774

Now im able to insert pictures in between text .
I see that a small space is also added ,on top of the picture ,when its inserted,im not sure if that is expected .


Yuzhen,can you confirm that is as expected ?
(Attaching a screenshot )

thanks

Rekha
Comment 34 Rekha S 2014-08-05 23:46:26 UTC
Created attachment 83780 [details]
Small space added after Image inserted between text
Comment 35 fanyuzhen 2014-08-07 09:53:40 UTC
Thanks Rekha for your verification. 

I have checked and do not see the small space added on top of the picture with build AOO RC1, aka AOO411m4(Build:9774)  -  Rev. 1614049.

I also can not figure out where is the small space in attachment 83780 [details], could you please indicate?

I think it is not expected behavior for an extra space, could you please create a new bug after we confirm this?

The problem described in this bug is verified fixed, I will mark it verified.