summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx3
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h5
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.hxx3
3 files changed, 10 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 5616323e199d..8f32a54e0a57 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -174,6 +174,7 @@ static int doc_getNumberOfParts(LibreOfficeKitDocument* pThis);
static void doc_setPart(LibreOfficeKitDocument* pThis, int nPart);
static unsigned char* doc_paintTile(LibreOfficeKitDocument* pThis,
const int nCanvasWidth, const int nCanvasHeight,
+ int* pRowStride,
const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight);
@@ -410,6 +411,7 @@ boost::shared_array< sal_uInt8 > ourBuffer;
// which /shouldn't/ apply in our case, but better to be safe here.
static unsigned char* doc_paintTile (LibreOfficeKitDocument* pThis,
const int nCanvasWidth, const int nCanvasHeight,
+ int* pRowStride,
const int nTilePosX, const int nTilePosY,
const int nTileWidth, const int nTileHeight)
{
@@ -432,6 +434,7 @@ static unsigned char* doc_paintTile (LibreOfficeKitDocument* pThis,
SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(aDevice.getSalVirtualDevice());
basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice();
+ *pRowStride = pBmpDev->getScanlineStride();
ourBuffer = pBmpDev->getBuffer();
pRet = ourBuffer.get();
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index b893067d0a67..cf2bcb2a757e 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -86,9 +86,14 @@ struct _LibreOfficeKitDocumentClass
int nPart);
// Get a pointer to a raw array, of size 3*nCanvasWidth*nCanvasHeight
+ // Basebmp's bitmap device seems to round the width up if needed
+ // for its internal buffer, i.e. the rowstride for the buffer may be larger
+ // than the desired width, hence we need to be able to return the
+ // rowstride too.
unsigned char* (*paintTile) (LibreOfficeKitDocument* pThis,
const int nCanvasWidth,
const int nCanvasHeight,
+ int* pRowStride,
const int nTilePosX,
const int nTilePosY,
const int nTileWidth,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 6fd2512bd477..09b4ae61b28f 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -61,12 +61,13 @@ public:
inline unsigned char* paintTile(const int nCanvasWidth,
const int nCanvasHeight,
+ int* pRowStride,
const int nTilePosX,
const int nTilePosY,
const int nTileWidth,
const int nTileHeight)
{
- return mpDoc->pClass->paintTile(mpDoc, nCanvasWidth, nCanvasHeight,
+ return mpDoc->pClass->paintTile(mpDoc, nCanvasWidth, nCanvasHeight, pRowStride,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
}
#endif // LOK_USE_UNSTABLE_API