[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-11-26 Thread Jan Holesovsky
 vcl/source/filter/wmf/enhwmf.cxx |   14 +--
 vcl/source/filter/wmf/winmtf.cxx |  146 ++-
 vcl/source/filter/wmf/winmtf.hxx |   20 -
 vcl/source/filter/wmf/winwmf.cxx |1 
 4 files changed, 123 insertions(+), 58 deletions(-)

New commits:
commit a39079ec9c3a017c912e45126ae980ff56127099
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Nov 25 16:21:12 2013 +0100

fdo#61272: Do the mapping correctly both for WMF and EMF.

Turns out that for the WMF, we already had everything set up correctly, we
were just overwriting the right settings with default data again :-) - fix
that.

Includes the following commits:

* Revert wmf-mm-text-1.diff: Fix WMF rendering, n#417818
* Revert wmf-mm-text.diff: Fix WMF rendering, n#417818
* fdo#56886 EMF: Fixes some scaling problems of clipped regions, Twips

Change-Id: I14b0c12b10f58eb7031f9da712dee76344c75159
Reviewed-on: https://gerrit.libreoffice.org/6802
Reviewed-by: Andras Timar andras.ti...@collabora.com
Tested-by: Andras Timar andras.ti...@collabora.com

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index f8b9884..541d68d 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -485,8 +485,8 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 EMFP_DEBUG(printf (\t\tunknown id: 0x%x\n,(unsigned int) 
id));
 }
 }
-} else if( !bEMFPlus || bHaveDC || nRecType == EMR_EOF )
-
+}
+else if( !bEMFPlus || bHaveDC || nRecType == EMR_EOF )
 switch( nRecType )
 {
 case EMR_POLYBEZIERTO :
@@ -518,14 +518,14 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 case EMR_SETWINDOWEXTEX :
 {   // #75383#
 *pWMF  nW  nH;
-pOut-SetWinExt( Size( nW, nH ) );
+pOut-SetWinExt( Size( nW, nH ), true);
 }
 break;
 
 case EMR_SETWINDOWORGEX :
 {
 *pWMF  nX32  nY32;
-pOut-SetWinOrg( Point( nX32, nY32 ) );
+pOut-SetWinOrg( Point( nX32, nY32 ), true);
 }
 break;
 
@@ -917,7 +917,7 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
 PolyPolygon aPolyPoly;
 if ( cbRgnData )
 ImplReadRegion( aPolyPoly, *pWMF, nRecSize );
-pOut-SetClipPath( aPolyPoly, iMode, sal_False );
+pOut-SetClipPath( aPolyPoly, iMode, sal_True );
 }
 break;
 
@@ -1352,7 +1352,7 @@ sal_Bool EnhWMFReader::ReadHeader()
 return sal_False;
 
 // bound size
-Rectangle rclBounds;// rectangle in logical units 1/100th mm
+Rectangle rclBounds;// rectangle in logical units
 *pWMF  nLeft  nTop  nRight  nBottom;
 rclBounds.Left() = nLeft;
 rclBounds.Top() = nTop;
@@ -1360,7 +1360,7 @@ sal_Bool EnhWMFReader::ReadHeader()
 rclBounds.Bottom() = nBottom;
 
 // picture frame size
-Rectangle rclFrame; // rectangle in device units
+Rectangle rclFrame; // rectangle in device units 1/100th mm
 *pWMF  nLeft  nTop  nRight  nBottom;
 rclFrame.Left() = nLeft;
 rclFrame.Top() = nTop;
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 63b0996..fc972e8 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -352,6 +352,20 @@ Color WinMtf::ReadColor()
 
//---
 
//---
 
+Point WinMtfOutput::ImplScale( const Point rPt)//Hack to set varying defaults 
for incompletely defined files.
+{
+if (mbIsMapDevSet  mbIsMapWinSet)
+{
+return 
Point((rPt.X())*mnWinExtX/mnDevWidth-mrclFrame.Left(),(rPt.Y())*mnWinExtY/mnDevHeight-mrclFrame.Top());
+}
+else
+{
+return 
Point((rPt.X())*UNDOCUMENTED_WIN_RCL_RELATION-mrclFrame.Left(),(rPt.Y())*UNDOCUMENTED_WIN_RCL_RELATION-mrclFrame.Top());
+}
+}
+
+//---
+
 Point WinMtfOutput::ImplMap( const Point rPt )
 {
 if ( mnWinExtX  mnWinExtY )
@@ -366,35 +380,32 @@ Point WinMtfOutput::ImplMap( const Point rPt )
 {
 switch( mnMapMode )
 {
-case MM_TEXT:
+case MM_LOENGLISH :
+{
 fX2 -= mnWinOrgX;
-fY2 -= mnWinOrgY;
-if( mnDevWidth != 1 || mnDevHeight != 1 ) {
-fX2 *= 2540.0/mnUnitsPerInch;
-fY2 *= 2540.0/mnUnitsPerInch;
-}
+fY2  = mnWinOrgY-fY2;
+fX2 *= 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-10-04 Thread Herbert Dürr
 vcl/source/fontsubset/sft.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d4b7546df3f9650b1773b9ad0cdd93aa01ae1097
Author: Herbert Dürr h...@apache.org
Date:   Fri Oct 4 15:14:22 2013 +

Resolves: #i123417# handle subsetting of empty ttf compound glyphs 
gracefully

(cherry picked from commit d519b07ecd4b67cedf1fe3e1860ef33a48a01ae4)
Signed-off-by: Caolán McNamara caol...@redhat.com

Conflicts:
vcl/source/fontsubset/sft.cxx

Change-Id: I51d4a97f1f01be49cb5ab058019cd153e23437bd
(cherry picked from commit 6489f97fc428446c53c17f885963776cdcc21490)
Signed-off-by: Caolán McNamara caol...@redhat.com

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index e110c12..a8e8e00 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -745,7 +745,10 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, 
sal_uInt32 glyphID, ControlPo
 
 } while (flags  MORE_COMPONENTS);
 
-
+// #i123417# some fonts like IFAOGrec have no outline points in some 
compound glyphs
+// so this unlikely but possible scenario should be handled gracefully
+if( myPoints.empty() )
+return 0;
 
 np = myPoints.size();
 
@@ -2620,7 +2623,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, 
sal_uInt32 glyphID)
 /* now calculate npoints and ncontours */
 ControlPoint *cp;
 n = GetTTGlyphPoints(ttf, glyphID, cp);
-if (n != -1)
+if (n  0)
 {
 int m = 0;
 for (int i = 0; i  n; i++)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-09-06 Thread Caolán McNamara
 vcl/source/window/builder.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c54873c97b2bf1deee964ad05ae7206011288087
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Sep 6 12:22:50 2013 +0100

Resolves: fdo#68081 why would I want a spinner that doesn't repeat

surely WB_SPIN should imply repeat in the first place, *shrug*

Change-Id: I1e4cb5a01d473cd0f8d907d566cd26d51a81da93
(cherry picked from commit f96771165ea145a759f1bab76cd34bb70def04f6)
Reviewed-on: https://gerrit.libreoffice.org/5838
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index feedbaf..a397912 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -704,7 +704,7 @@ Window *VclBuilder::makeObject(Window *pParent, const 
OString name, const OStri
 
 WinBits nBits = WB_RIGHT|WB_BORDER|WB_3DLOOK;
 if (!id.endsWith(-nospin))
-nBits |= WB_SPIN;
+nBits |= WB_SPIN | WB_REPEAT;
 
 if (sPattern.isEmpty())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-09-03 Thread Caolán McNamara
 vcl/source/window/builder.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit e57bb359ae4124f2603b9ab44d1534e4489e914a
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Sep 2 20:53:13 2013 +0100

stop annoying temp full screen windows appearing on insert-index entry

Change-Id: I730617f5ce28149f79d1d22efbfb7eab22e5840d
(cherry picked from commit 8f6b90a80c7b6e1c19422e944ca49657581e1042)
Reviewed-on: https://gerrit.libreoffice.org/5766
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 355b28f..feedbaf 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -767,6 +767,14 @@ Window *VclBuilder::makeObject(Window *pParent, const 
OString name, const OStri
 {
 extractStock(id, rMap);
 pWindow = new FixedImage(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK);
+//such parentless GtkImages are temps used to set icons on buttons
+//default them to hidden to stop e.g. insert-index entry flicking temp
+//full screen windows
+if (!pParent)
+{
+rMap[visible] = false;
+}
+
 }
 else if (name == GtkSeparator)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-08-29 Thread Caolán McNamara
 vcl/source/gdi/outdev3.cxx |   21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

New commits:
commit 6ae2a7521f5ea34d052e7eb51a63f936d1d06aae
Author: Caolán McNamara caol...@redhat.com
Date:   Wed Aug 28 20:22:26 2013 +0100

Resolves: fdo#68192 always recode from trad symbol to apple symbol

Even if the symbol font bit isn't set, the oox import route lacks the 
ability
to state that the bullet font is a font of symbol encoding. If the font is 
not
available on the system we go into fallback logic to state that famous 
symbol
fonts are in symbol encoding. But there is a symbol font on mac so its not
unknown and that doesn't happen. And the mac symbol font is not actually in
symbol encoding (seeing as it's all rearranged into the correct unicode
positions) so the recode logic is skipped in this special case to map the
microsoft/adobe private use area chars to the modern code points where they
were moved in the apple font.

I guess one alternative possible solution is to lookup all the fonts used 
in a
openxml doc using the fonttable stream where the charset info is available. 
But
seeing as it should only affect one particular font lets just move the 
encoder
test outside the issymbol block.

(cherry picked from commit b129867306ce918f4f8fbf9ec5f7dce86e52c9d2)

Conflicts:
vcl/source/gdi/outdev3.cxx

Change-Id: Ic5bd3ec15c8d8d99e2cab0fb67cc4bc33081c756
Reviewed-on: https://gerrit.libreoffice.org/5670
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index f7640f8..0350c83 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -2420,22 +2420,23 @@ ImplFontEntry* ImplFontCache::GetFontEntry( 
ImplDevFontList* pFontList,
 pEntry = pFontData-CreateFontInstance( aFontSelData );
 
 // if we found a different symbol font we need a symbol conversion 
table
-if( pFontData-IsSymbolFont() )
+if( pFontData-IsSymbolFont() || aFontSelData.IsSymbolFont() )
 {
 if( aFontSelData.maTargetName != aFontSelData.maSearchName )
 pEntry-mpConversion = ConvertChar::GetRecodeData( 
aFontSelData.maTargetName, aFontSelData.maSearchName );
+}
+
 #ifdef MACOSX
-//It might be better to dig out the font version of the target font
-//to see if it's a modern re-coded apple symbol font in case that
-//font shows up on a different platform
-if (!pEntry-mpConversion 
-aFontSelData.maTargetName.EqualsIgnoreCaseAscii(symbol) 
-aFontSelData.maSearchName.EqualsIgnoreCaseAscii(symbol))
-{
+//It might be better to dig out the font version of the target font
+//to see if it's a modern re-coded apple symbol font in case that
+//font shows up on a different platform
+if (!pEntry-mpConversion 
+aFontSelData.maTargetName.EqualsIgnoreCaseAscii(symbol) 
+aFontSelData.maSearchName.EqualsIgnoreCaseAscii(symbol))
+{
 pEntry-mpConversion = ConvertChar::GetRecodeData( 
OUString(Symbol), OUString(AppleSymbol) );
-}
-#endif
 }
+#endif
 
 // add the new entry to the cache
 maFontInstanceList[ aFontSelData ] = pEntry;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source vcl/unx

2013-07-08 Thread Ivan Timofeev
 vcl/source/control/scrbar.cxx|4 ++--
 vcl/source/gdi/salgdilayout.cxx  |4 ++--
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx |8 +---
 3 files changed, 5 insertions(+), 11 deletions(-)

New commits:
commit 54d8b3ae7ff97c798ea515b8196c1b2b9ccdf056
Author: Ivan Timofeev timofeev@gmail.com
Date:   Mon Jun 24 22:55:55 2013 +0400

fdo#66335: fix fdo#44582 and fdo#63254 differently

This combines the following cherry picked commits:

1) fdo#66335: gtk: Revert hacks for RTL scrollbars

returning false here in getNativeControlRegion results in a fallback to
square buttons in vcl scrollbar code. But there is no problem in gtk+ 
backend
in this case, let's fix the problem differently.

This reverts commits 898a3e84807bccbb876e3f5583728f6d24e05e9a and
e8e82bd2109b82ddd535cdac30303249c6b62942.

(cherry picked from commit 48e1d9c7afe5c2a39d9a08d7a38f7c8ff39d8c84)

2) fdo#44582: fix scrollbars in RTL UI

(cherry picked from commit e3a801e2454eed2e61202bbacca01fe3fcc20c1d)

3) fdo#63254: correct re-mirroring formula

This patch fixes horizontal scrollbar in Calc when a sheet is RTL and UI is 
LTR.

When a particular window (horizontal scrollbar in this case) is RTL and a 
whole
UI is LTR this code used for mirroring and re-mirroring back coordinates. 
AFAICS
mirroring is correct, but re-mirroring is not.

The used formula comes from commit 
69b684b12e42bf1396bdffca88ca880ac3c2e00b, and
the same formula appears in the other variant of overloaded function 
mirror:
 mirror(sal_uInt32, const SalPoint*, SalPoint*, const OutputDevice*, bool),
but it does not affect the bug.

(cherry picked from commit a08f579e3704fbd97590f9b050d250ae445725a7)

Conflicts:
vcl/source/control/scrbar.cxx

Change-Id: I0ccaa8998fe87403b3606828eaf3f5bd1dbe6bb4
Reviewed-on: https://gerrit.libreoffice.org/4622
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Reviewed-by: Abdulaziz A Alayed aala...@kacst.edu.sa
Tested-by: Abdulaziz A Alayed aala...@kacst.edu.sa
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx
index b99ff26..6689904 100644
--- a/vcl/source/control/scrbar.cxx
+++ b/vcl/source/control/scrbar.cxx
@@ -330,9 +330,9 @@ void ScrollBar::ImplCalc( sal_Bool bUpdate )
 
 if ( GetStyle()  WB_HORZ )
 {
-if ( GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_LEFT,
+if ( GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? 
PART_BUTTON_RIGHT: PART_BUTTON_LEFT,
 aControlRegion, 0, ImplControlValue(), 
rtl::OUString(), aBoundingRegion, aBtn1Region ) 
- GetNativeControlRegion( CTRL_SCROLLBAR, PART_BUTTON_RIGHT,
+ GetNativeControlRegion( CTRL_SCROLLBAR, IsRTLEnabled()? 
PART_BUTTON_LEFT: PART_BUTTON_RIGHT,
 aControlRegion, 0, ImplControlValue(), 
rtl::OUString(), aBoundingRegion, aBtn2Region ) )
 {
 maBtn1Rect = aBtn1Region;
diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx
index bb1c55d..987d0cf 100644
--- a/vcl/source/gdi/salgdilayout.cxx
+++ b/vcl/source/gdi/salgdilayout.cxx
@@ -107,7 +107,7 @@ void SalGraphics::mirror( long x, const OutputDevice 
*pOutDev, bool bBack ) con
 {
 long devX = pOutDevRef-GetOutOffXPixel();   // re-mirrored 
mnOutOffX
 if( bBack )
-x = x - pOutDevRef-GetOutputWidthPixel() + devX - 
pOutDevRef-GetOutOffXPixel() + 1;
+x = devX + (pOutDevRef-GetOutputWidthPixel() + devX) - (x 
+ 1);
 else
 x = pOutDevRef-GetOutputWidthPixel() - (x - devX) + 
pOutDevRef-GetOutOffXPixel() - 1;
 }
@@ -143,7 +143,7 @@ void SalGraphics::mirror( long x, long nWidth, const 
OutputDevice *pOutDev, bo
 {
 long devX = pOutDevRef-GetOutOffXPixel();   // re-mirrored 
mnOutOffX
 if( bBack )
-x = x - pOutDevRef-GetOutputWidthPixel() + devX - 
pOutDevRef-GetOutOffXPixel() + nWidth;
+x = devX + (pOutDevRef-GetOutputWidthPixel() + devX) - (x 
+ nWidth);
 else
 x = pOutDevRef-GetOutputWidthPixel() - (x - devX) + 
pOutDevRef-GetOutOffXPixel() - nWidth;
 }
diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx 
b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
index e4bd038..e627257 100755
--- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
@@ -1041,13 +1041,7 @@ sal_Bool GtkSalGraphics::getNativeControlRegion(  
ControlType nType,
 rNativeContentRegion.Right() = 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-07-02 Thread Caolán McNamara
 vcl/source/window/dialog.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c6c5636a69fa9261e02ac357dec0e8987a5ad829
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jul 2 15:19:20 2013 +0100

Resolves: fdo#66502 set AutoMnemonics before calculating layout

Change-Id: I3274ec9e8e4e1f61f0108a3e6ba64107128736c2
(cherry picked from commit 00601259144f5b49b516581ca6ae28fc6e524030)
Reviewed-on: https://gerrit.libreoffice.org/4680
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 513dd50..b007193 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -694,12 +694,12 @@ void Dialog::StateChanged( StateChangedType nType )
 
 if ( nType == STATE_CHANGE_INITSHOW )
 {
-if (isLayoutEnabled())
-setInitialLayoutSize();
-
 if ( GetSettings().GetStyleSettings().GetAutoMnemonic() )
 ImplWindowAutoMnemonic( this );
 
+if (isLayoutEnabled())
+setInitialLayoutSize();
+
 if ( !HasChildPathFocus() || HasFocus() )
 GrabFocusToFirstControl();
 if ( !(GetStyle()  WB_CLOSEABLE) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-24 Thread Caolán McNamara
 vcl/source/glyphs/graphite_layout.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 627a9d087163ff98e966c01f625b09fb766c837a
Author: Caolán McNamara caol...@redhat.com
Date:   Wed May 22 09:26:32 2013 +0100

WaE: signed/unsigned comparison

Change-Id: Iaa439c268eda24d700471560927d8f4c0f2e017b
(cherry picked from commit 6a0a33444255fcdbe16500de24fc5bfd74adca4b)

diff --git a/vcl/source/glyphs/graphite_layout.cxx 
b/vcl/source/glyphs/graphite_layout.cxx
index 8a99bb4..1190408 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -594,7 +594,7 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs 
rArgs)
 nSegCharLimit - rArgs.mnEndCharPos, bRtl);
 }
 }
-size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + 
mnSegCharOffset,
+int numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + 
mnSegCharOffset,
 rArgs.mpStr + (rArgs.mnLength  limit + 64 ? limit + 64 : 
rArgs.mnLength), NULL);
 if (rArgs.mnMinCharPos + numchars  limit) numchars = limit - 
rArgs.mnMinCharPos; // fdo#52540
 if (mpFeatures)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-23 Thread Zhe Wang
 vcl/source/gdi/pdfwriter_impl.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 95ad41e7da7423639157c8fe7a5fc29066760689
Author: Zhe Wang wangz...@apache.org
Date:   Fri Sep 7 04:33:47 2012 +

fdo#33281, i#120627 [From Symphony]the text on the Y axis is reversed when 
export ppt file to PDF format.

* subversion/main/vcl/source/gdi/pdfwriter_impl.cxx
[]Change nXOffset value from the distance of axis Y between two points to 
the distance between two points.

Patch by: Tang Mengtmyl2...@gmail.com
Suggested by: Wang Zhe kingwise...@gmail.com
Found by: Tang Meng tmyl2...@gmail.com
Review by: Wang Zhe kingwise...@gmail.com
(cherry picked from commit 58b6a6161e7edd10d33fdb67510e7d68440128f9)

Signed-off-by: Miklos Vajna vmik...@suse.cz

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index e93b111..d96a7f0 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7513,7 +7513,12 @@ void PDFWriterImpl::drawVerticalGlyphs(
 }
 aDeltaPos += (m_pReferenceDevice-PixelToLogic( Point( 
(int)((double)nXOffset/fXScale), 0 ) ) - m_pReferenceDevice-PixelToLogic( 
Point() ) );
 if( i  rGlyphs.size()-1 )
-nXOffset += rGlyphs[i+1].m_aPos.Y() - rGlyphs[i].m_aPos.Y();
+// [Bug 120627] the text on the Y axis is reversed when export ppt 
file to PDF format
+{
+long nOffsetX = rGlyphs[i+1].m_aPos.X() - rGlyphs[i].m_aPos.X();
+long nOffsetY = rGlyphs[i+1].m_aPos.Y() - rGlyphs[i].m_aPos.Y();
+nXOffset += (int)sqrt(double(nOffsetX*nOffsetX + 
nOffsetY*nOffsetY));
+}
 if( ! rGlyphs[i].m_nGlyphId )
 continue;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-22 Thread László Németh
 vcl/source/glyphs/graphite_layout.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 7d1e6cb0564a1eb886fd8f95adbcc7d8b9aa028f
Author: László Németh nem...@numbertext.org
Date:   Wed May 22 09:11:13 2013 +0200

fdo#52540 fix hyphenation of Graphite ligatures

Change-Id: I3c6aef6d845a7494d54b3c902654b21f3939e8cf
Reviewed-on: https://gerrit.libreoffice.org/3999
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/glyphs/graphite_layout.cxx 
b/vcl/source/glyphs/graphite_layout.cxx
index 7b663bd..8a99bb4 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -596,6 +596,7 @@ gr_segment * GraphiteLayout::CreateSegment(ImplLayoutArgs 
rArgs)
 }
 size_t numchars = gr_count_unicode_characters(gr_utf16, rArgs.mpStr + 
mnSegCharOffset,
 rArgs.mpStr + (rArgs.mnLength  limit + 64 ? limit + 64 : 
rArgs.mnLength), NULL);
+if (rArgs.mnMinCharPos + numchars  limit) numchars = limit - 
rArgs.mnMinCharPos; // fdo#52540
 if (mpFeatures)
 pSegment = gr_make_seg(mpFont, mpFace, 0, mpFeatures-values(), 
gr_utf16,
 rArgs.mpStr + mnSegCharOffset, 
numchars, bRtl);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-17 Thread Eike Rathke
 vcl/source/control/field2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2c7f6b004cd04f427529968d004405b1a95f74bb
Author: Eike Rathke er...@redhat.com
Date:   Fri May 17 17:23:26 2013 +0200

obtain days in month from non-normalized date, fdo#63805 related

Change-Id: I05cefb96d7d6290ff7e1a89fa88b21da7a6c82a2
(cherry picked from commit 59d6bde4045e928b5d68fb23e3340fa0e48f3e33)
Reviewed-on: https://gerrit.libreoffice.org/3946
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 725f697..0ecd576 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1365,7 +1365,7 @@ static void ImplDateIncrementMonth( Date rDate, sal_Bool 
bUp )
 }
 }
 
-sal_uInt16 nDaysInMonth = rDate.GetDaysInMonth();
+sal_uInt16 nDaysInMonth = Date::GetDaysInMonth( rDate.GetMonth(), 
rDate.GetYear());
 if ( rDate.GetDay()  nDaysInMonth )
 rDate.SetDay( nDaysInMonth );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-09 Thread Thorsten Behrens
 vcl/source/gdi/print2.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a10bc9322dd234549a4d061f77df038d89fb5c2a
Author: Thorsten Behrens tbehr...@suse.com
Date:   Tue May 7 18:36:01 2013 +0200

Fix fdo#40421 Take current clip into account for shape bounds.

Seems with the extensive drawinglayer rework, we now get bitmap
fills rendered via clip polygon and subsequent bitmap tiles. To
get the true bound rect of the current metaaction, clip it against
outdev's clip region bounds (as some reasonably cheap best-effort
approximation).

Change-Id: I4ecf04e2d94da21acc97362a1a65a965c7176077
Reviewed-on: https://gerrit.libreoffice.org/3815
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx
index 5f7ccad..3111ba3 100644
--- a/vcl/source/gdi/print2.cxx
+++ b/vcl/source/gdi/print2.cxx
@@ -627,7 +627,14 @@ static Rectangle ImplCalcActionBounds( const MetaAction 
rAct, const OutputDevic
 }
 
 if( !aActionBounds.IsEmpty() )
-return rOut.LogicToPixel( aActionBounds );
+{
+// fdo#40421 limit current action's output to clipped area
+if( rOut.IsClipRegion() )
+return rOut.LogicToPixel(
+rOut.GetClipRegion().GetBoundRect().Intersection( 
aActionBounds ) );
+else
+return rOut.LogicToPixel( aActionBounds );
+}
 else
 return Rectangle();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-05-09 Thread Stephan Bergmann
 vcl/source/gdi/svgdata.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2814ac645f0e35d51c1cfc48fb84dbf68f8b4dc
Author: Stephan Bergmann sberg...@redhat.com
Date:   Sat Feb 16 22:39:13 2013 +0100

Work around problem with boost::shared_array(NULL) ctor and Boost 1.53.0

...claiming

  templateclass Y boost::shared_arrayT::shared_array(Y*)

is not a viable option due to mismatched types 'Y*' and 'long int'

Change-Id: I8db321cd25cd73c84fa2a3124c9ec1018c131d5f
(cherry picked from commit b62048701cea5024383e19314592f2edcd9810fd)

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/vcl/source/gdi/svgdata.cxx b/vcl/source/gdi/svgdata.cxx
index f98abcd..4d15ec3 100644
--- a/vcl/source/gdi/svgdata.cxx
+++ b/vcl/source/gdi/svgdata.cxx
@@ -166,7 +166,7 @@ SvgData::SvgData(const SvgDataArray rSvgDataArray, 
sal_uInt32 nSvgDataArrayLeng
 
 //
 SvgData::SvgData(const OUString rPath):
-maSvgDataArray(NULL),
+maSvgDataArray(),
 mnSvgDataArrayLength(0),
 maPath(rPath),
 maRange(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-04-03 Thread Caolán McNamara
 vcl/source/control/tabctrl.cxx |3 ++-
 vcl/source/window/tabpage.cxx  |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b307085bcbf5e17c1d72171c33a5cc1cffd70f38
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 15 12:38:42 2013 +

Resolves: fdo#61241 background style dialog too small

(cherry picked from commit 1ccbb620946c7032c57054550b08ad5362fe1c3f)

Conflicts:
vcl/source/control/tabctrl.cxx
vcl/source/window/tabpage.cxx

Change-Id: Ie7396b63a64e89bb7aa7c0e284faab7ed380c4c1
Reviewed-on: https://gerrit.libreoffice.org/3188
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 4e1afc2..19163f1 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -29,6 +29,7 @@
 #include vcl/tabpage.hxx
 #include vcl/tabctrl.hxx
 #include vcl/controllayout.hxx
+#include vcl/layout.hxx
 #include vcl/lstbox.hxx
 
 #include controldata.hxx
@@ -2179,7 +2180,7 @@ Size TabControl::calculateRequisition() const
 if (!pPage)
 continue;
 
-Size aPageSize(pPage-GetOptimalSize(WINDOWSIZE_PREFERRED));
+Size aPageSize(VclContainer::getLayoutRequisition(*pPage));
 
 if (aPageSize.Width()  aOptimalPageSize.Width())
 aOptimalPageSize.Width() = aPageSize.Width();
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 3546c4f..d3b1f34 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -222,7 +222,7 @@ Size TabPage::GetOptimalSize(WindowSizeType eType) const
 return Window::GetOptimalSize(eType);
 Size aSize;
 if (isLayoutEnabled())
-aSize = GetWindow(WINDOW_FIRSTCHILD)-GetOptimalSize(eType);
+aSize = 
VclContainer::getLayoutRequisition(*GetWindow(WINDOW_FIRSTCHILD));
 else
 aSize = getLegacyBestSizeForChildren(*this);
 return Window::CalcWindowSize(aSize);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-03-28 Thread Michael Meeks
 vcl/source/window/dlgctrl.cxx |   46 +-
 1 file changed, 10 insertions(+), 36 deletions(-)

New commits:
commit 1107e4d7e03ecd3f36993d362b6b42e5806817d8
Author: Michael Meeks michael.me...@suse.com
Date:   Wed Mar 27 16:45:05 2013 +

fdo#62094 - fix infinite loop in radio button group iteration.

Simplify the code too - we copy the vector anyway, so reversing it
should be cheap.

Change-Id: Ie655ba3044c7e0dd5a15b0e839a3712a32a1e298
Reviewed-on: https://gerrit.libreoffice.org/3095
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 6c481da..e6c1ddd 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -533,39 +533,14 @@ namespace
 return (pWindow  isVisibleInLayout(pWindow)  
isEnabledInLayout(pWindow)  pWindow-IsInputEnabled());
 }
 
-bool backInGroup(std::vectorRadioButton*::reverse_iterator aRevStart, 
std::vectorRadioButton* rGroup)
+bool focusNextInGroup(std::vectorRadioButton*::iterator aStart, 
std::vectorRadioButton* rGroup)
 {
-std::vectorRadioButton*::reverse_iterator aI(aRevStart);
-while (aI != rGroup.rend())
-{
-Window *pWindow = *aI;
-
-if (isSuitableDestination(pWindow))
-{
-pWindow-ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD 
);
-return true;
-}
-}
-
-aI = rGroup.rbegin();
-while (aI != aRevStart)
-{
-Window *pWindow = *aI;
-
-if (isSuitableDestination(pWindow))
-{
-pWindow-ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD 
);
-return true;
-}
-}
+std::vectorRadioButton*::iterator aI(aStart);
 
-return false;
-}
+if (aStart != rGroup.end())
+++aI;
 
-bool forwardInGroup(std::vectorRadioButton*::iterator aStart, 
std::vectorRadioButton* rGroup)
-{
-std::vectorRadioButton*::iterator aI(aStart);
-while (++aI != rGroup.end())
+for (; aI != rGroup.end(); ++aI)
 {
 Window *pWindow = *aI;
 
@@ -576,8 +551,7 @@ namespace
 }
 }
 
-aI = rGroup.begin();
-while (aI != aStart)
+for (aI = rGroup.begin(); aI != aStart; ++aI)
 {
 Window *pWindow = *aI;
 
@@ -598,14 +572,14 @@ namespace
 if (aGroup.size() == 1) //only one button in group
 return false;
 
+if (bBackward)
+std::reverse(aGroup.begin(), aGroup.end());
+
 std::vectorRadioButton*::iterator aStart(std::find(aGroup.begin(), 
aGroup.end(), pSourceWindow));
 
 assert(aStart != aGroup.end());
 
-if (bBackward)
-return 
backInGroup(std::vectorRadioButton*::reverse_iterator(aStart), aGroup);
-else
-return forwardInGroup(aStart, aGroup);
+return focusNextInGroup(aStart, aGroup);
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-03-01 Thread Caolán McNamara
 vcl/source/window/printdlg.cxx |   12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

New commits:
commit 569b4ed7a68751edafcca0b79e5c25d2370f96a4
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Mar 1 13:28:21 2013 +

Resolves: fdo#61656 use order and orientation combobox select pos as index

not the associated entry data, which isn't set for these simple
1 to 1 position - data comboboxes

Change-Id: I0c73786bca00684cedc4672d0ad5e61d0c1f9bd7
(cherry picked from commit 9c7cf46fbf01f62ea9520c4ba1ec4748fe62b20b)
Reviewed-on: https://gerrit.libreoffice.org/2490
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0e63800..0e88fa2 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -449,11 +449,7 @@ void PrintDialog::NUpTabPage::initFromMultiPageSetup( 
const vcl::PrinterControll
 mpBorderCB-Check( i_rMPS.bDrawBorder );
 mpNupRowsEdt-SetValue( i_rMPS.nRows );
 mpNupColEdt-SetValue( i_rMPS.nColumns );
-for( sal_uInt16 i = 0; i  mpNupOrderBox-GetEntryCount(); i++ )
-{
-if( int(sal_IntPtr(mpNupOrderBox-GetEntryData( i ))) == i_rMPS.nOrder 
)
-mpNupOrderBox-SelectEntryPos( i );
-}
+mpNupOrderBox-SelectEntryPos( i_rMPS.nOrder );
 if( i_rMPS.nRows != 1 || i_rMPS.nColumns != 1 )
 {
 mpNupPagesBox-SelectEntryPos( mpNupPagesBox-GetEntryCount()-1 );
@@ -1444,8 +1440,7 @@ void PrintDialog::updateNup()
 
 aMPS.bDrawBorder= maNUpPage.mpBorderCB-IsChecked();
 
-int nOrderMode = int(sal_IntPtr(maNUpPage.mpNupOrderBox-GetEntryData(
-   maNUpPage.mpNupOrderBox-GetSelectEntryPos() )));
+int nOrderMode = maNUpPage.mpNupOrderBox-GetSelectEntryPos();
 if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB )
 aMPS.nOrder = PrinterController::LRTB;
 else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR )
@@ -1455,8 +1450,7 @@ void PrintDialog::updateNup()
 else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL )
 aMPS.nOrder = PrinterController::TBRL;
 
-int nOrientationMode = 
int(sal_IntPtr(maNUpPage.mpNupOrientationBox-GetEntryData(
- 
maNUpPage.mpNupOrientationBox-GetSelectEntryPos() )));
+int nOrientationMode = maNUpPage.mpNupOrientationBox-GetSelectEntryPos();
 if( nOrientationMode == SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE )
 aMPS.aPaperSize = maNupLandscapeSize;
 else if( nOrientationMode == SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-02-26 Thread Lionel Elie Mamane
 vcl/source/fontsubset/sft.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit e99ba6c7ed32b97112df174c8986ca2ced919f68
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Tue Feb 26 12:13:41 2013 +0100

Don't abort when myPoints is empty

Change-Id: I6bbb2a1cce1c89b94d027acf94fd712706bff422
Reviewed-on: https://gerrit.libreoffice.org/2425
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 3e41baf..e110c12 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -752,7 +752,8 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, 
sal_uInt32 glyphID, ControlPo
 pa = (ControlPoint*)calloc(np, sizeof(ControlPoint));
 assert(pa != 0);
 
-memcpy( pa, myPoints[0], np*sizeof(ControlPoint) );
+if (np  0)
+memcpy( pa, myPoints[0], np*sizeof(ControlPoint) );
 
 *pointArray = pa;
 return np;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-02-25 Thread Michael Meeks
 vcl/source/gdi/bitmapex.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 0b73b1f6e3358dc484c4e684b3c8055da7071eb5
Author: Michael Meeks michael.me...@suse.com
Date:   Fri Feb 22 16:53:39 2013 +

perf: avoid scaling images to the same size at some cost.

Change-Id: Icae65a8bf48f76801c536607055be066be0bd49f
(cherry picked from commit cb8fcf5a169f030827b1150c50b6ed284717e485)

Signed-off-by: Fridrich Å trba fridrich.st...@bluewin.ch

diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index f699432..45fe0aa 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -368,7 +368,9 @@ sal_Bool BitmapEx::Scale( const Size rNewSize, sal_uLong 
nScaleFlag )
 {
 sal_Bool bRet;
 
-if( aBitmapSize.Width()  aBitmapSize.Height() )
+if( aBitmapSize.Width()  aBitmapSize.Height() 
+( rNewSize.Width()  != aBitmapSize.Width() ||
+  rNewSize.Height() != aBitmapSize.Height() ) )
 {
 bRet = Scale( (double) rNewSize.Width() / aBitmapSize.Width(),
   (double) rNewSize.Height() / aBitmapSize.Height(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-02-25 Thread Michael Stahl
 vcl/source/filter/wmf/emfwr.cxx |   15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 4536979e19d6a9a913f677225a122c13a51da1fa
Author: Michael Stahl mst...@redhat.com
Date:   Mon Feb 25 13:22:07 2013 +0100

fdo#59405 fdo#60638: EMFWriter::ImplWrite: write EMF_PLUS comments

When editing the Visio OLE object, there is a preview file generated,
which is apparently an EMF file (strangely initially inserting the Visio
object seems to result in a totally unproblematic WMF file).
The EMF file apparently has almost its entire content stored in
MetaCommentAction of type EMF_PLUS, which is thrown away when writing
the file again.

Change-Id: I77a08454da673c1825aaa8421606737e7e8bc82c
(cherry picked from commit bf8450cfa2e9e899c716fbddadd7d5485aefe520)
Reviewed-on: https://gerrit.libreoffice.org/2396
Tested-by: Fridrich Strba fridr...@documentfoundation.org
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index c4caf02..80d4573 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -1388,12 +1388,25 @@ void EMFWriter::ImplWrite( const GDIMetaFile rMtf )
 break;
 }
 
+case( META_COMMENT_ACTION ):
+{
+MetaCommentAction const*const pCommentAction(
+static_castMetaCommentAction const*(pAction));
+if (pCommentAction-GetComment() == EMF_PLUS)
+{
+ImplBeginCommentRecord(WIN_EMR_COMMENT_EMFPLUS);
+m_rStm.Write(pCommentAction-GetData(),
+ pCommentAction-GetDataSize());
+ImplEndCommentRecord();
+}
+}
+break;
+
 case( META_MASK_ACTION ):
 case( META_MASKSCALE_ACTION ):
 case( META_MASKSCALEPART_ACTION ):
 case( META_WALLPAPER_ACTION ):
 case( META_TEXTLINE_ACTION ):
-case( META_COMMENT_ACTION ):
 case( META_GRADIENTEX_ACTION ):
 {
 // !!!  we don't want to support these actions
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source

2013-02-25 Thread Muthu Subramanian
 vcl/source/filter/wmf/emfwr.cxx |  204 +++-
 vcl/source/filter/wmf/emfwr.hxx |   12 ++
 2 files changed, 215 insertions(+), 1 deletion(-)

New commits:
commit 32bc874ded4f9108a32bd76a53ecc001e6ba2a83
Author: Muthu Subramanian sumu...@suse.com
Date:   Thu Dec 6 12:21:24 2012 +0530

n#780748: Basic EMF+ implementation.

* Minimalistic implementation of EMF+ export
* Currently exports transparent polygons.
(cherry picked from commit f1fee2a65c8c1968798e1246a4b455d9160d8eb9)

Change-Id: I0c24c29b77c50f898fe1b8ce1904179292a1bb72
Reviewed-on: https://gerrit.libreoffice.org/2395
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 80d4573..cf8a748 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -130,6 +130,9 @@
 #define WIN_SRCPAINT0x00EE0086L
 #define WIN_SRCAND  0x008800C6L
 #define WIN_SRCINVERT   0x00660046L
+#define WIN_EMR_COMMENT_EMFSPOOL0xL
+#define WIN_EMR_COMMENT_EMFPLUS 0x2B464D45L
+#define WIN_EMR_COMMENT_PUBLIC  0x43494447L
 
 #define HANDLE_INVALID  0x
 #define MAXHANDLES  65000
@@ -154,10 +157,194 @@
 
 #define MM_ANISOTROPIC  8
 
+typedef enum
+{
+  EmfPlusHeader = 0x4001,
+  EmfPlusEndOfFile  = 0x4002,
+  EmfPlusComment= 0x4003,
+  EmfPlusGetDC  = 0x4004,
+  EmfPlusMultiFormatStart   = 0x4005,
+  EmfPlusMultiFormatSection = 0x4006,
+  EmfPlusMultiFormatEnd = 0x4007,
+  EmfPlusObject = 0x4008,
+  EmfPlusClear  = 0x4009,
+  EmfPlusFillRects  = 0x400A,
+  EmfPlusDrawRects  = 0x400B,
+  EmfPlusFillPolygon= 0x400C,
+  EmfPlusDrawLines  = 0x400D,
+  EmfPlusFillEllipse= 0x400E,
+  EmfPlusDrawEllipse= 0x400F,
+  EmfPlusFillPie= 0x4010,
+  EmfPlusDrawPie= 0x4011,
+  EmfPlusDrawArc= 0x4012,
+  EmfPlusFillRegion = 0x4013,
+  EmfPlusFillPath   = 0x4014,
+  EmfPlusDrawPath   = 0x4015,
+  EmfPlusFillClosedCurve= 0x4016,
+  EmfPlusDrawClosedCurve= 0x4017,
+  EmfPlusDrawCurve  = 0x4018,
+  EmfPlusDrawBeziers= 0x4019,
+  EmfPlusDrawImage  = 0x401A,
+  EmfPlusDrawImagePoints= 0x401B,
+  EmfPlusDrawstring = 0x401C,
+  EmfPlusSetRenderingOrigin = 0x401D,
+  EmfPlusSetAntiAliasMode   = 0x401E,
+  EmfPlusSetTextRenderingHint   = 0x401F,
+  EmfPlusSetTextContrast= 0x4020,
+  EmfPlusSetInterpolationMode   = 0x4021,
+  EmfPlusSetPixelOffsetMode = 0x4022,
+  EmfPlusSetCompositingMode = 0x4023,
+  EmfPlusSetCompositingQuality  = 0x4024,
+  EmfPlusSave   = 0x4025,
+  EmfPlusRestore= 0x4026,
+  EmfPlusBeginContainer = 0x4027,
+  EmfPlusBeginContainerNoParams = 0x4028,
+  EmfPlusEndContainer   = 0x4029,
+  EmfPlusSetWorldTransform  = 0x402A,
+  EmfPlusResetWorldTransform= 0x402B,
+  EmfPlusMultiplyWorldTransform = 0x402C,
+  EmfPlusTranslateWorldTransform= 0x402D,
+  EmfPlusScaleWorldTransform= 0x402E,
+  EmfPlusRotateWorldTransform   = 0x402F,
+  EmfPlusSetPageTransform   = 0x4030,
+  EmfPlusResetClip  = 0x4031,
+  EmfPlusSetClipRect= 0x4032,
+  EmfPlusSetClipPath= 0x4033,
+  EmfPlusSetClipRegion  = 0x4034,
+  EmfPlusOffsetClip = 0x4035,
+  EmfPlusDrawDriverstring   = 0x4036,
+  EmfPlusStrokeFillPath = 0x4037,
+  EmfPlusSerializableObject = 0x4038,
+  EmfPlusSetTSGraphics  = 0x4039,
+  EmfPlusSetTSClip  = 0x403A
+} EmfPlusRecordType;
+
+
 // -
 // - EMFWriter -
 // -
 
+void EMFWriter::ImplBeginCommentRecord( sal_Int32 nCommentType )
+{
+ImplBeginRecord( WIN_EMR_GDICOMMENT );
+m_rStm.SeekRel( 4 );
+m_rStm (sal_Int32) nCommentType;
+}
+
+void EMFWriter::ImplEndCommentRecord()
+{
+if( mbRecordOpen )
+{
+sal_Int32 nActPos = m_rStm.Tell();
+m_rStm.Seek( mnRecordPos + 8 );
+m_rStm  (sal_uInt32)( nActPos - mnRecordPos - 0xc );
+m_rStm.Seek( nActPos );
+}
+ImplEndRecord();
+}
+
+void EMFWriter::ImplBeginPlusRecord( sal_uInt16 nType, sal_uInt16 nFlags )
+{
+DBG_ASSERT( !mbRecordPlusOpen, Another EMF+ record is already opened! );
+
+if( !mbRecordPlusOpen )
+{
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - vcl/source vcl/uiconfig

2013-02-11 Thread Caolán McNamara
 vcl/source/window/builder.cxx  |   33 -
 vcl/uiconfig/ui/printdialog.ui |2 +-
 2 files changed, 21 insertions(+), 14 deletions(-)

New commits:
commit 03ca2a8fde19498e8c584c899877c7332204a082
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Feb 8 15:06:08 2013 +

resolve fdo#60450 - Printer list is missing its border in Print dialog

Reviewed-on: https://gerrit.libreoffice.org/2043
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com
(cherry picked from commit f10ba07935951e6c74663a35de9a79b7d66beb37)

Conflicts:
vcl/source/window/builder.cxx

allow a custom border property for drawing areas

(cherry picked from commit e258b760563dc2a69a1cc8b0c8b7b4c15a2774ad)

Change-Id: I2e28b9f9d52bcb01b04f98d39d12b6d8a627bec5
1e5777e5dcc04d0aa53d1ac4b9091f310ae59035
Reviewed-on: https://gerrit.libreoffice.org/2052
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 68bc434..355b28f 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -307,16 +307,16 @@ void VclBuilder::handleTranslations(xmlreader::XmlReader 
reader)
 
 namespace
 {
-OString extractPattern(VclBuilder::stringmap rMap)
+OString extractCustomProperty(VclBuilder::stringmap rMap)
 {
-OString sPattern;
-VclBuilder::stringmap::iterator aFind = rMap.find(OString(pattern));
+OString sCustomProperty;
+VclBuilder::stringmap::iterator aFind = 
rMap.find(OString(customproperty));
 if (aFind != rMap.end())
 {
-sPattern = aFind-second;
+sCustomProperty = aFind-second;
 rMap.erase(aFind);
 }
-return sPattern;
+return sCustomProperty;
 }
 
 bool extractResizable(VclBuilder::stringmap rMap)
@@ -688,7 +688,7 @@ Window *VclBuilder::makeObject(Window *pParent, const 
OString name, const OStri
 else if (name == GtkSpinButton)
 {
 extractSpinAdjustment(id, rMap);
-OString sPattern = extractPattern(rMap);
+OString sPattern = extractCustomProperty(rMap);
 OString sUnit = sPattern;
 
 for (sal_Int32 i = 0; i  sPattern.getLength(); ++i)
@@ -755,7 +755,11 @@ Window *VclBuilder::makeObject(Window *pParent, const 
OString name, const OStri
 //   everything over to SvTreeViewBox
 //d) remove the users of makeSvTreeViewBox
 extractModel(id, rMap);
-pWindow = new ListBox(pParent, WB_LEFT|WB_VCENTER|WB_3DLOOK);
+WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+OString sBorder = extractCustomProperty(rMap);
+if (!sBorder.isEmpty())
+nWinStyle |= WB_BORDER;
+pWindow = new ListBox(pParent, nWinStyle);
 }
 else if (name == GtkLabel)
 pWindow = new FixedText(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK);
@@ -802,7 +806,10 @@ Window *VclBuilder::makeObject(Window *pParent, const 
OString name, const OStri
 else if (name == GtkNotebook)
 pWindow = new TabControl(pParent, WB_STDTABCONTROL|WB_3DLOOK);
 else if (name == GtkDrawingArea)
-pWindow = new Window(pParent);
+{
+OString sBorder = extractCustomProperty(rMap);
+pWindow = new Window(pParent, sBorder.isEmpty() ? 0 : WB_BORDER);
+}
 else if (name == GtkTextView)
 {
 extractBuffer(id, rMap);
@@ -1013,7 +1020,7 @@ void VclBuilder::handleTabChild(Window *pParent, 
xmlreader::XmlReader reader)
 if (nDelim != -1)
 {
 OString sPattern = sID.copy(nDelim+1);
-aProperties[OString(pattern)] = sPattern;
+aProperties[OString(customproperty)] = sPattern;
 sID = sID.copy(0, nDelim);
 }
 }
@@ -1340,7 +1347,7 @@ Window* VclBuilder::handleObject(Window *pParent, 
xmlreader::XmlReader reader)
 {
 OString sClass;
 OString sID;
-OString sPattern;
+OString sCustomProperty;
 
 xmlreader::Span name;
 int nsId;
@@ -1359,7 +1366,7 @@ Window* VclBuilder::handleObject(Window *pParent, 
xmlreader::XmlReader reader)
 sal_Int32 nDelim = sID.indexOf(':');
 if (nDelim != -1)
 {
-sPattern = sID.copy(nDelim+1);
+sCustomProperty = sID.copy(nDelim+1);
 sID = sID.copy(0, nDelim);
 }
 }
@@ -1375,8 +1382,8 @@ Window* VclBuilder::handleObject(Window *pParent, 
xmlreader::XmlReader reader)
 
 stringmap aProperties, aPangoAttributes;
 
-if (!sPattern.isEmpty())
-aProperties[OString(pattern)] = sPattern;
+if (!sCustomProperty.isEmpty())
+aProperties[OString(customproperty)] = sCustomProperty;