Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance the image alignment for excel (#1760) #1761

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*************************************************************************************
* Copyright (c) 2011, 2012, 2013 James Talbut.
* Copyright (c) 2011, 2012, 2013, 2024 James Talbut and others
* jim-emitters@spudsoft.co.uk
*
*
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
*
* SPDX-License-Identifier: EPL-2.0
*
*
* Contributors:
* James Talbut - Initial implementation.
************************************************************************************/
Expand All @@ -33,15 +33,40 @@
*
*/
public class CellImage {

/** property: coordinates of the location */
public Coordinate location;

/** property: image index */
public int imageIdx;

/** property: image content object */
public IImageContent image;

/** property: image can be spanned */
public boolean spanColumns;

public CellImage(Coordinate location, int imageIdx, IImageContent image, boolean spanColumns) {
/** property: image can be spanned */
public String horizontalAlignment;

/** property: image can be spanned */
public String verticalAlignment;

/**
* Constructor
*
* @param location coordinates of the location
* @param imageIdx image index
* @param image image content object
* @param spanColumns image can be spanned
*/
public CellImage(Coordinate location, int imageIdx, IImageContent image, boolean spanColumns,
String horizontalAlignment, String verticalAlignment) {
this.location = location;
this.imageIdx = imageIdx;
this.image = image;
this.spanColumns = spanColumns;
this.horizontalAlignment = horizontalAlignment;
this.verticalAlignment = verticalAlignment;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,8 @@ public void recordImage(HandlerState state, Coordinate location, IImageContent i
}
}

state.images.add(new CellImage(location, imageIdx, image, spanColumns));
state.images.add(new CellImage(location, imageIdx, image, spanColumns,
element.getComputedStyle().getTextAlign(), element.getComputedStyle().getVerticalAlign()));
lastElement = image;
}
}
Expand Down
Loading
Loading