Issue 26572

Summary: Font Preview shows wrong text
Product: General Reporter: kla <thomas.klarhoefer>
Component: chartAssignee: kla <thomas.klarhoefer>
Status: CLOSED FIXED QA Contact: issues@graphics <issues>
Severity: Trivial    
Priority: P4 CC: IngridvdM, issues, kami911, tony.galmiche.ooo, weizhao
Version: 3.3.0 or older (OOo)Keywords: regression
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on:    
Issue Blocks: 72764    
Attachments:
Description Flags
patch_080328
none
patch_080331
none
patch_svx_080401
none
patch_svx_080402
none
patch_chart2_080410 none

Description kla 2004-03-16 15:16:32 UTC
The preview show not the results that we expected. (e.g. Tabpage Characters,
Font Effects)
Comment 1 kla 2004-03-16 15:17:21 UTC
Set Keyword
Comment 2 IngridvdM 2004-03-16 17:36:59 UTC
.
Comment 3 IngridvdM 2004-03-17 09:43:21 UTC
I you started the new chart from the calc the text preview in the object options
dialog does show the string that was selected in calc before, but it should show
the name of the font instead.
Comment 4 IngridvdM 2004-03-24 12:45:37 UTC
changed summary
Comment 5 kla 2004-08-11 10:00:36 UTC
according to http://www.openoffice.org/servlets/ReadMsg?list=releases&msgNo=7690
this issue will be set to OOoLater
Comment 6 IngridvdM 2005-09-06 13:46:12 UTC
set target for new chart issues
Comment 7 IngridvdM 2006-03-20 14:53:50 UTC
iha->bm: Please take over
Comment 8 IngridvdM 2006-03-21 20:10:39 UTC
changed summary to start with 'new chart: ' to avoid confusion with regular
chart issues
Comment 9 bjoern.milcke 2006-04-13 16:59:43 UTC
->OS: The character tabpage (svx/source/dialog/chardlg.cxx) uses a font preview
(svx/source/dialog/fntctrl.cxx). The text rendered in the preview is determined
in SvxFontPrevWindow::Paint(). It is taken from the current SfxViewShell. In our
case this is the Calc, as the Chart is not sfx-based.

Please allow to set a preview text at the SvxCharBasePage by different means. I
noticed that there is a method UseResourceText() at the SvxFontPrevWindow
control. Maybe that can be used to override the auto-text for preview.

As we don't want to use very specific text, but only "Sample Text", a method
like UseStandardPreviewText() would be better, thus we would avoid introducing
some standard resource text in the chart that is better kept in svx.

Alternatively, instead of using the SfxViewShell interface, maybe there is a way
to find something similar to the "current" shell via the UNO framework. If the
"current" frame is found, it could be tried to get the SfxViewShell via
UnoTunnel. If this doesn't work, a standard text is used (which would be the
case for the new chart then).
Comment 10 Oliver Specht 2006-06-20 14:31:01 UTC
Target adjusted
Comment 11 kami911 2007-05-08 16:55:14 UTC
Can you please check this enhancement request?
http://qa.openoffice.org/issues/show_bug.cgi?id=61008
Comment 12 Oliver Specht 2007-05-09 07:43:05 UTC
->kami_: I'm not sure if issue 61008 intends to remove the use of the selected
text of the current document. The problem there is that you are not required to
select a language for the font you use so you don't know which preview text to
use. ( Besides the fact that the preview doesn't support all three script types.) 
Comment 13 kami911 2007-05-09 11:01:50 UTC
I think It should not be a problem. We might use the language of paragraph, If
this is not avaialable we can use the language of document, if it is not
available we can use the language of UI. What about this? Is it possible?
Comment 14 kami911 2007-05-09 11:10:00 UTC
Of course if text is selected we should display the selected text, if no text
were selected we might show the language depended example sentence.
Comment 15 Oliver Specht 2007-05-09 11:50:40 UTC
->kami_: We should move discussions about issue 61008 to that issue. 
For this one the problem remains: The selected text is queried from the wrong
document.
Comment 16 kami911 2007-05-09 12:54:20 UTC
U're -> ;o)
Comment 17 Martin Hollmichel 2007-09-12 13:07:42 UTC
move to 3.x target according to http://wiki.services.openoffice.org/wiki/Target_3x
Comment 18 weiz 2008-03-28 07:31:36 UTC
->iha: The attached is the patch of this issue. Please let me know if you have 
any suggestions. Thank you! :-)
Comment 19 weiz 2008-03-28 07:33:36 UTC
Created attachment 52337 [details]
patch_080328
Comment 20 Oliver Specht 2008-03-28 10:30:30 UTC
Issue type changed to patch
->iha: The svx part seems to be o.k. Would you please take a look at the changes
in Chart.
Comment 21 IngridvdM 2008-03-28 19:36:51 UTC
->weiz:
In cases when the font name is used for the preview and the user changes the
font in the dialog the preview does not update to show the new font name. This
feels not good. Could you please fix that in addition?
Furthermore the string paramter in SetPreviewText should be given per reference
and not per copy.
When introducing the additional itemID in svxids.hrc please check
SID_SVX_FIRSTFREE and SID_SVX_END.
And two naming issues:
UNO Interface should be named starting with 'x', so please replace aStringTest
with xFormattedString.
The newly introduced itemID is not chart specific, so it shouldn't be named
chart specific. I would suggest to use 'SID_CHAR_DLG_PREVIEW_STRING' instead of
'SID_CHART_STRING'.
Thanks!
Comment 22 weiz 2008-03-31 07:18:21 UTC
->iha: Thank you very much for you suggestions. The new patch is finished, 
please find the final attachment.
Comment 23 weiz 2008-03-31 07:19:31 UTC
Created attachment 52383 [details]
patch_080331
Comment 24 IngridvdM 2008-03-31 16:58:59 UTC
->weiz: Using the character dialog for text shapes in impress the preview text
does not change when switching fonts. This does work without the patch.
Comment 25 weiz 2008-04-01 08:05:21 UTC
->iha: This is the new patch for svx module, it works fine in my test cases. :-)
Comment 26 weiz 2008-04-01 08:08:36 UTC
Created attachment 52421 [details]
patch_svx_080401
Comment 27 IngridvdM 2008-04-01 10:33:34 UTC
The patch does work now. Please optimize the code design further to make the
code easier to maintain as discussed via chat :-) .
Comment 28 weiz 2008-04-02 02:49:28 UTC
->iha: The patch for optimize the code design is submitted. Thanks again for 
your help. :-)
Comment 29 weiz 2008-04-02 02:51:04 UTC
Created attachment 52446 [details]
patch_svx_080402
Comment 30 IngridvdM 2008-04-02 18:54:25 UTC
->weiz: The svx part of the patch is fine now.
While checking it in to CWS chart25 I only found one now superfluous check
!pImpl->bTextInited in line 676. I removed it for better readability as the
whole section is only entered when that condition is true anyhow.
The chart part still has bugs.
When formatting 'All Titles' or 'All axes' the font preview displays still the
selection from the Calc. And there is at least one further buggy scenario.
The file SchWhichPairs.hxx needs some modifications. It has a similar design
problem as the svx part has had. Two things that always need to go together were
added in two parts. Try to identify which other ids always are used for the
character tab page and try to find a solution which combines these ids always
with the new font preview.
There is one wrongly added occurence of SID_CHAR_DLG_PREVIEW_STRING.
Comment 31 weiz 2008-04-10 07:24:33 UTC
->iha: The new patch for chart2 module is finished, but I am not sure whether 
it's the best way to fix this issue, so I need your suggestions. Thanks in 
advance!
Comment 32 weiz 2008-04-10 07:26:04 UTC
Created attachment 52705 [details]
patch_chart2_080410
Comment 33 IngridvdM 2008-04-10 10:39:07 UTC
->weiz: Thanks a lot! The patch works fine now. With the systematic introduction
of the mini macro for the character items now also the preview in the character
tabpage of the regression curve equations does show a correct string :-) .
Your introduction of bAffectsMultipleObjects does work and is correct in
principle. But I replaced it anyhow with a smaller solution, which has the
advantage that it will work also in the future for other elements than titles.
Thanks a lot!
I checked all in to CWS chart25.
Comment 34 IngridvdM 2008-05-15 10:10:41 UTC
@Thomas, please verify in CWS chart25.
Comment 35 kla 2008-05-20 12:31:54 UTC
Seen ok (include all attributes) in CWS chart25 -> verified
Comment 36 kla 2008-08-29 13:11:04 UTC
Seen ok in current master -> closed