Apache OpenOffice (AOO) Bugzilla – Issue 26572
Font Preview shows wrong text
Last modified: 2013-02-24 21:19:55 UTC
The preview show not the results that we expected. (e.g. Tabpage Characters, Font Effects)
Set Keyword
.
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.
changed summary
according to http://www.openoffice.org/servlets/ReadMsg?list=releases&msgNo=7690 this issue will be set to OOoLater
set target for new chart issues
iha->bm: Please take over
changed summary to start with 'new chart: ' to avoid confusion with regular chart issues
->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).
Target adjusted
Can you please check this enhancement request? http://qa.openoffice.org/issues/show_bug.cgi?id=61008
->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.)
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?
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.
->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.
U're -> ;o)
move to 3.x target according to http://wiki.services.openoffice.org/wiki/Target_3x
->iha: The attached is the patch of this issue. Please let me know if you have any suggestions. Thank you! :-)
Created attachment 52337 [details] patch_080328
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.
->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!
->iha: Thank you very much for you suggestions. The new patch is finished, please find the final attachment.
Created attachment 52383 [details] patch_080331
->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.
->iha: This is the new patch for svx module, it works fine in my test cases. :-)
Created attachment 52421 [details] patch_svx_080401
The patch does work now. Please optimize the code design further to make the code easier to maintain as discussed via chat :-) .
->iha: The patch for optimize the code design is submitted. Thanks again for your help. :-)
Created attachment 52446 [details] patch_svx_080402
->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.
->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!
Created attachment 52705 [details] patch_chart2_080410
->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.
@Thomas, please verify in CWS chart25.
Seen ok (include all attributes) in CWS chart25 -> verified
Seen ok in current master -> closed